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

Categories

0 votes
627 views
in Technique[技术] by (71.8m points)

php - Mysql can't perform more than 1 query at a time

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

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

1 Answer

0 votes
by (71.8m points)

You need to use mysqli::multi_query.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...