title: SQL insert into error seems to stop mid string
body: <p>I have this code to insert into a DB. And for some reason it is breaking on the 3rd parameter. If i take it out the other 2 work just fine.</p>
  
  <p>Also i know it should be mysqli, im working with old code and just trying to get this part working. Will address updating later.</p>
  
  <pre><code>echo $_SESSION['test']['categoryname'];
  $result = mysql_query('INSERT INTO '.$db_table_prefix.'saved_tests (user, category, categoryname) VALUES ('. $user["id"] .','. $_SESSION["test"]["category"] .','. $_SESSION["test"]["categoryname"] .')', $db_connection); 
  </code></pre>
  
  <p>this outputs on the page:</p>
  
  <p>Airway Respiration and Ventilation</p>
  
  <p>failed to insert data1064: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'Respiration and Ventilation)' at line 1</p>
  
  <p>I cant seem to figure out what the issue is. you can see printing the variable displays the full string.</p>