Page 1 of 1

Help for a beginer ( i will repay in gold)

Posted: Wed May 17, 2006 6:12 pm
by Milan
I have a code that checks if the verification number matches the number in the database, i now have trouble changing the value of the "active" field in the table from 0 to 1,

So, i need a line of code that will change the value of the field "Active" to 1 (table name is users, database name TESTBASE) for the user specified in the cookie ( i know how to extract this)

any help will be awesome!

thanks!

Posted: Wed May 17, 2006 6:45 pm
by Burrito

Code: Select all

$query = "UPDATE `users` set `active` = 1 where `user` = '".mysql_escape_string($_COOKIE['user'])."'";
mysql_query($query)
  or die(mysql_error());

AWESOME!

Posted: Wed May 17, 2006 6:48 pm
by Milan
The force flows strong within you!

As i promised, first time i see you my golden teeth it yours!

yup!

Posted: Wed May 17, 2006 6:55 pm
by Milan
Yup it works!

( it's not that i doubted...)

Thanks a lot for taking time to help me with this!