php-mysql code doensn't work?
hi
this is php conde for enter values to the mysql table:
<html>
<body>
<?php
$db = mysql_connect("localhost", "root");
mysql_select_db("mydb",$db);
$query="INSERT INTO student4 VALUES (NULL, "zubair", "second", 500)";
$rt=mysql_query($query);
echo mysql_error();
if($rt){echo " Command is successful ";}
else {echo " Command is not successful ";}
?>
</html>
</body>
this is the student4 table with previous entry:
mysql> select * from student4;
+----+---------+-------+------+
| id | name | class | mark |
+----+---------+-------+------+
| 1 | shakeel | first | 500 |
+----+---------+-------+------+
1 row in set (0.08 sec)
any help please?
|