Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
menu search
person
Welcome To Ask or Share your Answers For Others

Categories

When I do:

$q = 'insert into movies values("lion king"); select * from movies;';
$result = $db->query($q);
echo mysqli_num_rows($result);

it says that $result is boolean, not mysqli result. if I check $result like this:

if(!$result) echo 'fail';

it outputs 'fail'.

Is mysql not capable of handling more than 1 query at a time? How do I solve this?

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
599 views
Welcome To Ask or Share your Answers For Others

1 Answer

You need to use mysqli::multi_query.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
...