PHP/SQL Help

benjy355

New member
I hope somebody here knows php well >_> Because this thing is pissing me right off
Anyways, for some reason my sql UPDATE query doesn't work right. It says it does everything fine, but I check the database, and nothing changes! :runaway:

PHP:
$query = 'UPDATE `cp_logindata` SET `sessionkey` = \'' . $sessionkey . '\' AND CONVERT(`sessionkey` USING utf8) AND SET `failedlogins` = \'0\' AND CONVERT(`failedlogins` USING utf8) AND SET `lastip` = \'' . $_SERVER["REMOTE_ADDR"] . '\' AND CONVERT(`lastip` USING utf8) LIMIT 1;';

mysql_query($query);
-Tyvm :confused:
 
Last edited:
You need to separate with commas instead of AND statements. Ex:

UPDATE `mytable` SET `field1`='3', `field2`='hello', `field3`='world'
 
>_> Then phpMyAdmin lied to me...
Thanks
*Tries*
What about converting though?
(CONVERT('something' using utf8))
 
Last edited:
awww... thosr spam sites gave me quite a laugh, and made me laugh more when i sent them ot evil_genius
:evil:
 
benjy355 said:
>_> Then phpMyAdmin lied to me...
Thanks
*Tries*
What about converting though?
(CONVERT('something' using utf8))
Nevermind! :D I don't have to convert my charsets

And thanks! It worked :D
 
Back
Top