[PHP-DB] MD5 Update

2003-03-16 Thread Dani Matielo
Please, help me with this:


$preencher = mysql_query(SELECT * FROM alemao);
$update = mysql_query(UPDATE alemao SET codigo = md5(concat(nome,email)));

mysql_close ($db);


whats wrong with my code? when I tell him to

? if ($update) echo Insert MD5;
else echo No; ?

he returns Insert MD5, but nothing happens in the db... whats wrong?

Thank you in advance,

Dani



-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



RE: [PHP-DB] MD5 Update

2003-03-16 Thread John W. Holmes
 $preencher = mysql_query(SELECT * FROM alemao);
 $update = mysql_query(UPDATE alemao SET codigo =
 md5(concat(nome,email)));
 
 mysql_close ($db);
 
 
 whats wrong with my code? when I tell him to
 
 ? if ($update) echo Insert MD5;
 else echo No; ?
 
 he returns Insert MD5, but nothing happens in the db... whats wrong?

You're query is fine (assuming column names are correct), something has
to happen. What do you expect to happen? Your UPDATE query is going to
update every row in the table...

---John W. Holmes...

PHP Architect - A monthly magazine for PHP Professionals. Get your copy
today. http://www.phparch.com/



-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php