Jump to content

Archived

This topic is now archived and is closed to further replies.

snapper64

PHP Error 'unexpected T_STRING' . . .

Recommended Posts

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 file
include '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 database
mysql_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

Share this post


Link to post
Share on other sites
The $sql definition looks mangled to me. Try this instead:
[code]$sql = 'UPDATE `users`'
        . ' SET `status` = `1`'
        . ' WHERE `password` = `$md5` AND `timestamp` = `$base`';[/code]

Share this post


Link to post
Share on other sites
[!--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]


Share this post


Link to post
Share on other sites

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.