title: run multiple mysql queries after each other?
body: <p>hi i am trying to run multiple queries to insert certain values into certain tables and columns.</p>
  
  <p>i am currently running this query which inserts the values into ptb_registrations and it works fine but now i want to add some of these values additionally into ptb_users and i keep getting can not update database error.</p>
  
  <pre><code>&lt;?php ob_start(); 
  // CONNECT TO THE DATABASE
      require('../includes/_config/connection.php');
  // LOAD FUNCTIONS
      require('../includes/functions.php');
  $username = $_POST['username'];
  $password = $_POST['password'];
  $firstname = $_POST['firstname'];
  $lastname = $_POST['lastname'];
  $email = $_POST['email'];
  $number = $_POST['number'];
  $dob = $_POST['dob'];
  $accounttype = $_POST['accounttype'];
  $query="INSERT INTO ptb_registrations (id,
  username,
  password,
  firstname,
  lastname,
  email,
  number,
  dob,
  accounttype,
  date_created )
  VALUES('NULL',
  '".$username."',
  '".$password."',
  '".$firstname."',
  '".$lastname."',
  '".$email."',
  '".$number."',
  '".$dob."',
  '".$accounttype."',
  now()
  )";
  mysql_query($query) or dieerr();
  function dieerr() {
  echo '&lt;!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"&gt;
  &lt;html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en"&gt;
  &lt;head&gt;
  &lt;meta http-equiv="Content-Type" content="text/html;charset=UTF-8" /&gt;
  &lt;title&gt;&lt;/title&gt;
  
  &lt;link rel="stylesheet" type="text/css" href="css/style.css" media="all" /&gt;
  
  
  &lt;/head&gt;
  &lt;body background="../assets/img/form/backdrop.png" style="background-repeat:no-repeat; background-size: 100% 2000px;"&gt;
  
  &lt;div id="container"&gt;
  &lt;h1&gt;REGISTRATION WAS UNSUCCESFULL&lt;/h1&gt;&lt;br/&gt;&lt;br/&gt;&lt;br/&gt;&lt;br/&gt;
  &lt;div class="textarea"&gt;
      &lt;h3&gt;Oooops! I tried my hardest to register you onto our system but it looks like one of us has made an error :-( Try and have another go and if there is still a problem then contact one of the Tech Team at &lt;a href=\"mailto:support@playtimeboys.com\"&gt;Support@PlaytimeBoys.com&lt;/a&gt;&lt;/h3&gt;
  &lt;/div&gt;
      &lt;div class="man_reg"&gt;&lt;img src="../assets/img/help_support/man.png" alt="" width="210" height="214" /&gt;&lt;/div&gt;&lt;/div&gt;
  &lt;div id="progress_bar"&gt;
      &lt;div id="progress"&gt;&lt;/div&gt;
      &lt;div id="progress_text"&gt;Registration Completed&lt;/div&gt;
  &lt;/div&gt;
  
  &lt;style&gt;
  .textarea{
      padding-left:55px;
      padding-right:55px;
      text-align:center;
  }
  .man_reg{
      margin-top:54px;
      margin-left:450px;
  }
  
  &lt;/style&gt;    
  &lt;/body&gt;
  &lt;/html&gt;';
  exit;
  }
  ?&gt;
  </code></pre>
  
  <p>can someone please show me how i might add to my existing query with this:</p>
  
  <pre><code>$result="INSERT INTO ptb_users (id,
  user_id,
  firstname )
  VALUES('NULL',
  'NULL',
  '".$firstname."',
  '".$lastname."',
  '".$email."',
  '".$number."',
  '".$dob."',
  '".$accounttype."',
  now()
  )";
  </code></pre>