Gossamer Forum
Home : General : Databases and SQL :

MySQL - ENCODE problem

Quote Reply
MySQL - ENCODE problem
Hi,

Need an urgent help!

I have a script like this:

mysql_db_query ($SQL_DB, "UPDATE admin SET
adminpassword = ENCODE($pwd, 'pass')
WHERE admin_id = '$admin_id'
");

for changing password. But it sometimes work and most of the time doesn't. When it doesn't work, the old password is not updated at all! It looks like the SQL statement is not processed. But I'm sure the problem did go through this statement as the next statement is run.

Please help...

Thanks,

Alex
Quote Reply
Re: [alexluk88] MySQL - ENCODE problem In reply to
What is the value of $admin_id?
========================================
Buh Bye!

Cheers,
Me
Quote Reply
Re: [alexluk88] MySQL - ENCODE problem In reply to
Add some debug info;


Code:
my $debug = 1;

print "\$pwd is: " . $pwd . "<BR>" if $debug;
print "\$admin_id is: " . $admin_id . "<BR>" if $debug;

mysql_db_query ($SQL_DB, "UPDATE admin SET
adminpassword = ENCODE($pwd, 'pass')
WHERE admin_id = '$admin_id'
");

See what that shows...

Also, are you grabbing any MySQL errors that may be returned?

Cheers

Andy (mod)
andy@ultranerds.co.uk
Want to give me something back for my help? Please see my Amazon Wish List
GLinks ULTRA Package | GLinks ULTRA Package PRO
Links SQL Plugins | Website Design and SEO | UltraNerds | ULTRAGLobals Plugin | Pre-Made Template Sets | FREE GLinks Plugins!