I am not able to connect my php code with the mysql database in localhost.Here is my php code:
<? php
echo "hi";
$con=mysql_connect("localhost","root","*********");
if(!$con)
{
die('could not connect'.mysql_error());
}
mysql_select_db("my_db",$con);
mysql_query("insert into my_table(firstname,idnumber) values ('$_post[firstname]','$_post[idnumber]')");
echo "'hi ur name is ('$_post[firstname]')";
mysql_close($con);
?>
What should i do? and also when i am running the php code it is also not echoing the "hi" statement {echo "hi"}. Is that a connection problem?
I got the result. Now whenever am entering the data in the form,the table shows a row is updated but the fields have 0..not the entered data.