TEL:400-8793-956
当前位置:程序、服务器

如何从Mysql到Mysqli进行函数查询

提问者: 近期获赞: 浏览人数: 发布时间:2021-02-03 14:42:31

 问:您能帮忙将过时的函数查询转换为mysqli吗?

 
 
 
    函数query($ querystring)
        {
                $ this-> querytext = $ querystring;
                $ this-> query_id = mysql_query($ this-> querytext,$ this-> conn);
                $ this-> errno = erroInfo($ this-> conn);
                $ this-> error = mysql_error($ this-> conn);
                if($ this-> query_id) 
                {
                         if(strtolower(substr(trim($ this-> querytext),0,6))=='select'){
                        $ this-> rows = mysqli_result :: $ num_rows($ this -> query_id);
                   } else {
                        $ this-> rows = 0;
           }
                        $ this-> row = 0;
 
                        $ this-> rows = 0;
                        $ this-> row = 0;
                        $ this-> halt(“查询失败!”);
                }
        }
}
 
 
答:您可以将mysql_query更改为mysqli_query,如果这不起作用,则还必须在新的mysqli中建立连接。希望这个帮助和工作
上一篇: 如何使用MySQL解决PHP连接错误
下一篇: 如何在NodeJs应用程序中执行多个插入查询?