What does $mysqli->query() return?
葫芦娃平衡盘
葫芦娃平衡盘 2017-08-20 23:05:16
0
1
1279

$sql="SELECT * FROM stu where id='$id'";
$jg=mysqli_query($mysqli,$sql);

Baidu said that as long as there is no error, it will return true

This is a statement to query the database. I know that $jg is a piece of data. In what form does it exist? I use echo to check the error report, print_r, and var_dump to check only its type. What should I do if I want to check or call the content inside?


葫芦娃平衡盘
葫芦娃平衡盘

reply all(1)
Peter_Zhu

The query result of the data table is a resource type. You need to use a special function to convert the result into an array type before it can be used. It can be converted into an index or an association. Determine according to need. If you don’t understand, please refer to the "PHP User Manual"

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template