snapper64 Posted May 30, 2006 Share Posted May 30, 2006 Hi Guys,I have got a problem and i cant figure out why. Basically i have created a page that will connect to a database and modify the information within it. You can see my file below:[code]<?php// Include init fileinclude 'init.php';$md5 = md5($_GET['hash']);$base = base64_decode($_GET['stamp']);$sql = 'UPDATE `users`' . ' SET `status` = `1` . ' WHERE `password` = `$md5`' AND `timestamp` = `$base`;// And lastly, store the information in the databasemysql_query ($sql) or die ('Activation Failed');?>[/code]Unfortunately it is throwing up this error:[!--quoteo--][div class=\'quotetop\']QUOTE[/div][div class=\'quotemain\'][!--quotec--]Parse error: syntax error, unexpected T_STRING in /path/to/my/file.php on line 11[/quote]Any ideas???Thanks,Charlie Quote Link to comment https://forums.phpfreaks.com/topic/10795-php-error-unexpected-t_string/ Share on other sites More sharing options...
AndyB Posted May 30, 2006 Share Posted May 30, 2006 The $sql definition looks mangled to me. Try this instead:[code]$sql = 'UPDATE `users`' . ' SET `status` = `1`' . ' WHERE `password` = `$md5` AND `timestamp` = `$base`';[/code] Quote Link to comment https://forums.phpfreaks.com/topic/10795-php-error-unexpected-t_string/#findComment-40360 Share on other sites More sharing options...
jworisek Posted May 30, 2006 Share Posted May 30, 2006 [!--quoteo(post=378495:date=May 30 2006, 03:01 PM:name=snapper64)--][div class=\'quotetop\']QUOTE(snapper64 @ May 30 2006, 03:01 PM) [snapback]378495[/snapback][/div][div class=\'quotemain\'][!--quotec--][code]$sql = 'UPDATE `users`' . ' SET `status` = `1` . ' WHERE `password` = `$md5`' AND `timestamp` = `$base`;[/code][/quote]I could be wrong, but that doesn't look right...try this:[code]$sql ="UPDATE users SET status = '1' WHERE password = '$md5' AND timestamp = '$base'";[/code] Quote Link to comment https://forums.phpfreaks.com/topic/10795-php-error-unexpected-t_string/#findComment-40361 Share on other sites More sharing options...
snapper64 Posted May 30, 2006 Author Share Posted May 30, 2006 It works. Thanks for the speedy reply ! Quote Link to comment https://forums.phpfreaks.com/topic/10795-php-error-unexpected-t_string/#findComment-40365 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.