|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2004-07-17 16:12 UTC] georg@php.net
[2004-07-18 01:49 UTC] adamsbarker at hotmail dot com
[2004-07-19 06:38 UTC] georg@php.net
|
|||||||||||||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Sat Nov 15 03:00:02 2025 UTC |
Description: ------------ "mysqli_multi_query" works fine when only using 1 statement, however when using more than 1 statement the function returns empty. Reproduce code: --------------- $query = "SELECT * FROM database_name.first_table;"; $query .= "SELECT * FROM database_name.second_table"; /* execute multi query */ if (mysqli_multi_query($link, $query)) { do { /* store first result set */ if ($result = mysqli_store_result($link)) { while ($row = mysqli_fetch_row($result)) { printf("%s\n", $row[0]); } mysqli_free_result($result); } /* print divider */ if (mysqli_more_results($link)) { printf("-----------------\n"); } } while (mysqli_next_result($link)); } Expected result: ---------------- Works perfect when this line is taken out: $query .= "SELECT * FROM database_name.second_table"; But doesn't work when this line is kept in.