I have written s imple script to insert a row into a table ..In the browser it confirms the data insertion ..but when i go to the backend to check if the data has been inserted properly..theres no data..whats the problem.
heres the code :
Code: Select all
<html>
<body>
<?php
if ($dblink=mysql_connect("localhost","root",""))
{
echo "conected";
mysql_select_db("test",$dblink);
$mystring ="insert into product (prod_id,prod_name) values('2','fridge')";
if (mysql_query($mystring,$dblink))
{
echo "inserted <br> ";
mysql_query("commit");
}
else
{
echo "could not insert";
}
}
else
{
echo "disconected";
}
?>
</body>
</html>