Question: Any reasons why this not work? When I print the query to screen and runs it through phpMyAdmin it works. I left out the part where I connect to the database (MySQL). 

```
$query = "START TRANSACTION; ";
$query .= "INSERT INTO table1(text) VALUES('$question_description'); ";

for ($i = 0; $i < count($processed_answers); $i++) {
    $query .= "INSERT INTO table2(question_id, text, serial_number, is_correct) ".
              "VALUES($question_id, '".$processed_answers[$i]."', '".$serial_numbers[$i]."', 0); ";
}

foreach($categories as $category) {
    $query .= "INSERT INTO table3 VALUES($question_id, $category); ";
}

$query .= "COMMIT; ";
$result = $db->query($query);

```

Answer: 
Looks like you are attempting to run multiple statements, possibly through a `mysql_query()` or `mysqli->query()` which only support single statements. Instead you need to execute this with `mysqli->multi_query()` or `mysql_multi_query()`.
You are trying to run multiple queries at once, you should either run those queries one at a time or use the [mysqli::multi\_query](http://php.net/manual/en/mysqli.multi-query.php) method.