mysql_connect("localhost","root","XXX");
"create table S (pan char(10),yuan char(10),yu char(40))";
$sql="insert into s values('111','222','333')";
$a=mysql_query($sql);
if($b=mysql_fetch_array($a))
{
echo "$b[0]";
echo "
";
echo "$b[yuan]";
echo "
";
echo "$b[yu]";
echo "
";
echo "$b";
}
$c=mysql_fetch_row($a);
echo "$c";
echo "
";
echo "$a";
?>
错误信息:
Deprecated: mysql_connect(): The mysql extension is deprecated and will be removed in the future: use mysqli or PDO instead in C:\wamp\www\test.php on line 2
Warning: mysql_connect(): in C:\wamp\www\test.php on line 2
Deprecated: mysql_query(): The mysql extension is deprecated and will be removed in the future: use mysqli or PDO instead in C:\wamp\www\test.php on line 5
Warning: mysql_fetch_array() expects parameter 1 to be resource, boolean given in C:\wamp\www\test.php on line 6
Warning: mysql_fetch_row() expects parameter 1 to be resource, boolean given in C:\wamp\www\test.php on line 16
展开