Re: MySQL query results

From: Date: Sat, 23 Mar 2002 00:11:02 +0000
Subject: Re: MySQL query results
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-89783@lists.php.net to get a copy of this message
On 22 Mar 2002 at 16:41, Ashley M. Kirchner wrote: > Rick Emery wrote: > The query does get executed, and the record does get changed. > > The code looks like this: > > $conn = @MYSQL_CONNECT($host,$user,$password) ; > mysql_select_db($database, $conn); > $query = "UPDATE clients SET email_flag='0' WHERE > MD5(concat(email_address,'$key'))='$uniqueID' "; > $result = mysql_query($query, $conn); > $num_rows = mysql_num_rows($result); > echo "$num_rows Rows\n"; seems there is something wrong with the query, can you either echo the query and feed it directly to mysql, (e.g. in phpmyadmin) see what happens? also, i always do queries like this: $result=mysql_query($query) or die ('<H1><font color=red>Bad database request setting email flag </font></H2> in :' .__FILE__ .' line '.__LINE__ .'<br /><b>The query used was:</b> '.$query .'<br /><b>MySQL says</b> '.mysql_error() ); I find it is extremely useful in debugging. -- ! please check my email address ! ! only my email chayes@antenna.nl works ! ! email chayes@xs4all.nl is a black hole since januari 2002 ! Chris Hayes - Droef 35 - Wageningen

« previous php.general (#89783) next »