Jump to content


Photo

PHP Error SQL probs . . .


  • Please log in to reply
2 replies to this topic

#1 snapper64

snapper64
  • Members
  • PipPip
  • Member
  • 12 posts

Posted 31 May 2006 - 08:09 AM

Hi,

I have created an activation script for my registration script. It will eventually work by getting the encrypted password and timestamp from the URL. However because i ran into problems i commented out this section and just entered exact values(the same as those entered in the database, but its still failing !!!
<?php

// Include init file
include 'init.php';

//$md5 = md5($_GET['hash']);
//$base = base64_decode($_GET['stamp']);

$sql = 'UPDATE `users`'
        . ' SET `status` = `0`'
//              . ' WHERE `password` = `$md5` AND `timestamp` = `$base`';

              . ' WHERE `password` = `0b78601ab862c0c13becef26327f4f9c` AND `timestamp` = `1149021727`';

// And lastly, store the information in the database
mysql_query ($sql) or die(mysql_error()); // 

?>
I get this error when i run the script: 'Unknown column '0b78601ab862c0c13becef26327f4f9c' in 'where clause'

Any ideas ?

Thanks,

Charlie

#2 rathfon

rathfon
  • New Members
  • Pip
  • Newbie
  • 8 posts

Posted 31 May 2006 - 08:30 AM

<?php

// Include init file
include "init.php";

//$md5 = md5($_GET['hash']);
//$base = base64_decode($_GET['stamp']);

$sql = "UPDATE users SET status='0' WHERE password='0b78601ab862c0c13becef26327f4f9c' AND timestamp='1149021727'";

// And lastly, store the information in the database
mysql_query ($sql) or die(mysql_error()); // 

?>

Try that and let me know what error it gives.

#3 snapper64

snapper64
  • Members
  • PipPip
  • Member
  • 12 posts

Posted 31 May 2006 - 09:00 AM

Works perfectly.

Thanks a million,

Charlie




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users