next Posted July 25, 2008 Share Posted July 25, 2008 I can't figure out how to use this method can anyone help? For instance i have 2 procedures: 1) CALL get_forums('general'); (headers: forum_id, forum_title, forum_descr) 2) CALL count_threads(); (returns 1, retrieved with 'num_threads') i want to display it like this: ----- 1 ----- title ----- 1 ----- title ----- etc. i can't figure out how to retrieve info. Here is my code: <?php include('config/config.php'); //include('lib/database.class.php'); $dbh = new mysqli(SERVER, DB_USER, DB_PASSWORD, DB); $query = "CALL count_threads(); "; $query .= "CALL get_forums('general');"; $dbh->multi_query($query); do { $result = $dbh->store_result(); echo $result->fetch_object()->num_threads . '<br />'; $result->free(); $dbh->more_results(); while($result = $dbh->fetch_object()) echo $result->forum_title . '<br />'; } while($dbh->next_result()); ?> this query displays "1", then throws a fatal error: Fatal error: Call to undefined method mysqli::fetch_object() in E:\PortableApps\WOS\www\MovieTalk\test.php on line 17 PHP docs left me really confused :-\ Thanks in advance. Link to comment https://forums.phpfreaks.com/topic/116519-mysqli-multi_query-having-problems-understanding-it/ Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.