need help! about mysqli 'multi_query' method
Posted: Mon Mar 10, 2008 4:55 am
~pickle | Please use [ code=html ], [ code=php ], etc tags where appropriate when posting code. Your post has been edited to reflect how we'd like it posted. Please read:
Posting Code in the Forums to learn how to do it too.
i wanna transfer my data from database '$from' to '$to', first i reset tables in $to, use a mysqli method 'multi_query', but it always get an error:Commands out of sync; you can't run this command now when execute one of the INSERT operations
it seems no errors in my code, if is this a bug or not? How can i get rid of this kind of error message?
~pickle | Please use [ code=html ], [ code=php ], etc tags where appropriate when posting code. Your post has been edited to reflect how we'd like it posted. Please read:
Posting Code in the Forums to learn how to do it too.
Code: Select all
$sql = 'truncate table `bbs_classes_t`;';
$sql.= 'truncate table `bbs_subjects_t`;';
$sql.= 'truncate table `bbs_replies_t`;';
$sql.= 'truncate table `bbs_forums_t`;';
$sql.= 'truncate table `bbs_admin_assignment_t`;';
$sql.= 'truncate table `bbs_rules_assignment_t`;';
$sql.= 'truncate table `bbs_rules_t`;';
$to->multi_query($sql); //reset tables
$result = $from->query('select * from `bbs_class_info`'); //handle `bbs_class_info`
//...some get data and insert data operations
it seems no errors in my code, if is this a bug or not? How can i get rid of this kind of error message?
~pickle | Please use [ code=html ], [ code=php ], etc tags where appropriate when posting code. Your post has been edited to reflect how we'd like it posted. Please read: