I keep getting this error while trying to modify some tables. Here\'s my code:
/**  <- line 320
 *
 * @param array $guests_array
 * @param array $ticke         
        I don't think it will work this way. When you close the statement (e.g. $menu_stmt->close();) you also deallocate the statement handle. So the second time through the loop you don't have the prepared statements available to work with anymore.
Try closing the statements after the loop has finished executing.
usually this error come when you try to access a statement that has been closed
$stmt->close(); 
$stmt->num_rows;