The thing is that i have some dynamic columns and i use always the same php ajax page. So i get from the other page some coma separated strings. One with the columns, other with the table and other with the data. In the insert there is no problem because i do it this way:
$query = 'INSERT INTO '.$_GET["table"].' ('.$_GET["columns"].') VALUES('.$_GET["data"].')';
mysql_query($query, $link);
That transforms to this:
INSERT sys_users_cfg (usr,pwd,permission_id,image) VALUES ('pepwe2','1234','1','')
I need to do the UPDATE in the same way. with VALUES statement. Like:
UPDATE sys_users_cfg (usr,pwd,permission_id,image) VALUES ('pepwe2','1234','1','') WHERE usr_id = 33
That dosnt work. Is this posible?
Use the REPLACE INTO syntax instead if you’re updating using the primary key, e.g.
REPLACE INTO sys_users_cfg (usr_id,usr,pwd,permission_id,image) VALUES (33,'pepwe2','1234','1','').