MySQL Forums :: PHP :: MySQL 5.5.24 - error in your SQL syntax
MySQL 5.5.24 - error in your SQL syntax
Date: January 19, 2013 09:31AM
I'm having a problem with my PHP / MySQL request.
Here is the content I send from a form :
sites_admins_id = 4
<input type="hidden" name="sites_admins_id" value="<?php echo $siteslisting[$var3]['id']; ?>"/>
user_group = partner
<select name="user_group" id="user_group">
Here is the PHP script that sends the request :
$insertSQL = sprintf("UPDATE sites_admins SET group=%s WHERE id=%s",
$Query1 = mysql_query($insertSQL,$user) or die(mysql_error());
Here is the answer from MySQL
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 'group=partner WHERE id=4' at line 1
I exported the table to show you what it looks like :
CREATE TABLE IF NOT EXISTS `sites_admins` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`id_admin` int(11) NOT NULL,
`id_site` int(11) NOT NULL,
`group` varchar(8) NOT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=5 ;
I don't understand because I usually don't have any problem with this kind of requests, can somebody help ?
Edited 2 time(s). Last edit at 01/19/2013 09:37AM by Nono Seki.
Sorry, you can't reply to this topic. It has been closed.
Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.