我收到了这条消息
Warning: mysql_query() expects parameter 1 to be string, object given in
关于这一行:
$QSelPro = mysql_query($con,"SELECT * FROM products");
这有什么问题????
答案 0 :(得分:2)
来自mysql_query()的PHP手册:
mixed mysql_query ( string $query [, resource $link_identifier = NULL ] )
因此,改为
$QSelPro = mysql_query("SELECT * FROM products", $con);
同样来自同一页:
Warning
This extension is deprecated as of PHP 5.5.0, and will be removed in the future...
换句话说,请考虑不使用mysql_*
。它已被弃用。而是使用mysqli_*
或pdo