MYSQL SYNTAX ERROR 2- PLEASE HELP!

I keep getting this error:

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 'ON=‘2011-000’, C=‘U’, SC=‘2’, NC=‘Julio Figue’ at line 3

My query is:

<?php include "connection.php"; if(!isset($_POST["submit"])) { $q = "SELECT * FROM Invoices WHERE ID = $_GET[id]"; $result = mysql_query($q); $person = mysql_fetch_array($result); } where is the error here??

WELL THE ERROR WAS NOT IN THE QUERY ABOVE… ITS HERE
[php]<?php
if(isset($_POST[“submit”])) {

    $u =  "UPDATE invoices SET 
      
      
      
      OB='$_POST[inputOB]',
    C='$_POST[inputC]', 
     SC='$_POST[inputSC]',
     NC='$_POST[inputNC]',
     CA='$_POST[inputCA]', 
     TD='$_POST[inputTD]',
      ED='$_POST[inputED]',  
      D='$_POST[inputD]',  
      QTY='$_POST[inputQTY]', 
      R='$_POST[inputR]', 
      ST='$_POST[inputST]',    
      IVU='$_POST[inputIVU]',
       T='$_POST[inputT]',  
       
       
       WHERE ID = $_POST[id]
       
        ";
	 
      mysql_query($u) or die (mysql_error());
	  
	  echo "User has been modified!";
	  header("Location: index.php");


 

}
?>[/php]

please help me find an error…

error presented:

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 ‘WHERE ID = 3’ at line 20

nvm … i fixed it… i created everything again… tough but rewarding

Sponsor our Newsletter | Privacy Policy | Terms of Service