首页 > 解决方案 > PHP mysql查询中的错误

问题描述

我有两个这样的代码:

if($result=mysql_query($select))
while($row=mysql_fetch_array($result))
{

我想要这个代码的mysqli

标签: phpmysqlmysqli

解决方案


    $con=mysqli_connect("localhost","username","password","my_db");
    $sql="select * from table_name";
    if ($result=mysqli_query($con,$sql))
    {
        while ($row=mysqli_fetch_array($result))
        {

        }
    }

Please try this one 

推荐阅读