Call to undefined method mysqli:mysqli_query(),该怎么解决

WBOY
Release: 2016-06-13 12:24:41
Original
3126 people have browsed it

Call to undefined method mysqli::mysqli_query()
 出现这样提示:
Fatal error: Call to undefined method mysqli::mysqli_query() in
然后用
print_r(get_extension_funcs('mysqli'));打印mysqli,有mysqli_query函数
会不会是选择语句有问题
$_sql = "select 
m.id,
m.admin_user,
m.login_count,
m.last_ip,
m.last_time, 
l.level_name
from 
cms_manage as m,
cms_level as l
where
l.level = m.level
order by
m.id ASC
limit
0,10";
------解决思路----------------------
你这只是 sql 串,并没有执行
------解决思路----------------------
 Call to undefined method mysqli::mysqli_query()  这个报错意味着确实没有mysqli_query函数。虽然你用函数确定了mysqli_query是有的,试试重启下Apache。。。贴出你的具体代码看看
------解决思路----------------------
面向对象的使用方法:

mysqli::query ( string $query [, int $resultmode = MYSQLI_STORE_RESULT ] )
Copy after login


面向过程的使用方法:
mysqli_query ( mysqli $link , string $query [, int $resultmode = MYSQLI_STORE_RESULT ] )
Copy after login


也就是说,你要用mysqli_query()就不要用对象调用,$_db->mysqli_query()当然会出错。

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!