I'm trying to pass several create statements through mysqli->multi_query, I tested the multi_query statements with a couple of queries and it works and when I called it with my actual create statements it just wouldn't go through... there weren't any errors and it returned true. I tested the query itself in a script form using the query browser and it went through perfectly.
here's the mysqli statement I'm using
public static function multi_query($sql){
//connects to the database
if(!self::$instance)
{ $db = self::start_connection(); }
//instantiate the mysqli class
$mysqli = self::$instance;
$result = null;
if ($mysqli->multi_query($sql)) {
do {
/* store first result set */
if ($result = $mysqli->store_result()) {
$result->free();
}
/* print divider */
if ($mysqli->more_results()) {
//I just kept this since it seems useful
//try removing and see for yourself
}
} while ($mysqli->next_result());
}else{
return false;
}
return true;
}
Is there a limit to how many queries I can run using the multi_query function/method? I also can't run this in a .sql file since I'm generating the database based on the user's input. I guess I could fwrite into a .sql file and run that script with a simple mysqli->query but I would rather understand why I can't use mysqli->multi_query for this.
thanks to anyone who can help