mr.eVL Posted June 28, 2008 Share Posted June 28, 2008 Error in query: . 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 '' at line 1 Can someone explain to me what this error means? ??? LIKEWISE, IM FACING THIS ERROR TOO. I CANT UPDATE THE EDITED DATA. Parse error: parse error, unexpected T_VARIABLE in C:\Program Files\xampp\htdocs\FYP\save_company_contacts.php on line 43 $query = "INSERT into company_contacts (company_name, company_contact, company_fax, company_email, company_address, company_description, contactor_name, contactor_num) VALUE ('$company_name', '$company_contact', '$company_fax', '$company_email', '$company_address', '$company_description', '$contactor_name', '$contactor_num')"; $result = mysql_query($query) or die ("Error in query: $query. ".mysql_error()); $submitted = true; if($submitted) { $query = "UPDATE company_contacts set company_name='$company_name', company_contact='$company_contact', company_fax='$company_fax', company_email='$company_email', company_address='$company_address', company_description='$company_description', contactor_name='$contactor_name', contactor_num='$contactor_num' where id="$_GET['id']; print "You will be re-directing soon!"; } hope to hear from anyone soon. please! Link to comment https://forums.phpfreaks.com/topic/112337-syntax-error/ Share on other sites More sharing options...
mr.eVL Posted June 28, 2008 Author Share Posted June 28, 2008 FORGET TO MENTION ONE THING. EVEN IF I SUCCESSFULLY EDIT THE DATA, NOTHING SHOWN AND IT ADDS IT AS A NEW RECORD. WHY? Link to comment https://forums.phpfreaks.com/topic/112337-syntax-error/#findComment-576761 Share on other sites More sharing options...
woolyg Posted June 30, 2008 Share Posted June 30, 2008 Shouldn't you be using VALUES instead of 'VALUE'? Link to comment https://forums.phpfreaks.com/topic/112337-syntax-error/#findComment-577782 Share on other sites More sharing options...
fenway Posted July 1, 2008 Share Posted July 1, 2008 Shouldn't you be using VALUES instead of 'VALUE'? Yes, and enough upper case. Link to comment https://forums.phpfreaks.com/topic/112337-syntax-error/#findComment-579110 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.