【问题标题】:Error in PHP mysql queryPHP mysql查询中的错误
【发布时间】:2018-05-17 07:27:38
【问题描述】:

我有两个这样的代码:

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

我想要这段代码的mysqli

【问题讨论】:

  • 请查看此链接 [链接] (dev.mysql.com/doc/apis-php/en/…)。
  • 我们是来为您提供帮助的,而不是为您编写代码。向我们展示您迄今为止所做的尝试,与我们分享您的想法,我们会提供帮助。

标签: php mysql mysqli


【解决方案1】:
    $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 

【讨论】:

    猜你喜欢
    • 2010-09-05
    • 1970-01-01
    • 2017-01-17
    • 2018-11-10
    • 1970-01-01
    • 1970-01-01
    • 2016-04-02
    • 2014-05-04
    • 1970-01-01
    相关资源
    最近更新 更多