Click here to Skip to main content
15,897,371 members

Comments by mikeoabban (Top 61 by date)

mikeoabban 24-Jun-15 14:05pm View    
i have tried using PDO and MySQLi to connect but the data is not able to store into the database

setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION); // <== add this line
echo 'Connected to Database<br/>';

$value = $_POST['input1'];

$sql = "INSERT INTO demo (input1) VALUES ('$value')";



$dbh = null;
}
catch(PDOException $e)
{
echo $e->getMessage();
}

?>

and this

host_info . "\n";

$mysqli->close();

?>

please help me out
mikeoabban 24-Oct-14 13:06pm View    
the value of dtpDate1 and dtpDate2 are taking from 2 dateTimePicker
mikeoabban 17-May-14 0:54am View    
i am using a windows form in c# and ListItem is generating an error
mikeoabban 17-May-14 0:50am View    
no my form the system administrator enters data into the tblministries table (e.g. A B C D E F) using save button. when the form loads, A B C D E F loads into the checkedlistbox (cblMinistries). a user can check any of the data in the checkedlistbox (e.g. B C F) Which is saved into the tblMembershipministry table with the member ID. when a member enter his ID and click the search button, the form should load A B C D E F into the checkedlistbox and any data with the member ID from the tblMembershipministry table (B C F) should be checked.
please how do i resolve the problem. thank you

CREATE TABLE tblMinistries
(Homecellid int IDENTITY constraint pkMinid primary key clustered,
Homecellname varchar(300)not null)

CREATE TABLE tblMembershipministry
(FormattedMembershipid varchar(300),
Ministryname varchar(300)not null)
mikeoabban 16-May-14 15:29pm View    
this is the code i used to bind cblMinistries
public void PopuMinistry()
{
SqlConnection conn = new SqlConnection("Data Source=USER-PC;Initial Catalog=PIWCDB;User ID=sa;Password=mike");
if (conn.State != ConnectionState.Open)
{
conn.Open();
}
string SqlDataPull = ("select Homecellname from tblministries order by Homecellname");

SqlCommand cmd = new SqlCommand(SqlDataPull);
cmd.Connection = conn;
cmd.CommandType = CommandType.Text;
SqlDataReader dr = cmd.ExecuteReader();
while (dr.Read())
{
SqlDataPull = dr[0].ToString();
cblMinistries.Items.Add(SqlDataPull);
}
dr.Close();
}