RE: [PHP] Endless 'while' loops?

From: Date: Mon, 03 Nov 2003 03:29:10 +0000
Subject: RE: [PHP] Endless 'while' loops?
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-168371@lists.php.net to get a copy of this message
Thank you Lief, Hanuska and Jay for your comments and advice. > (it automagically knows which result it's on) This was the piece of information that I was missing. I did not know PHP had any "automagic" in it's handling of arrays. However, now that I think I know what's going on, my code still does not seem to be working. When I execute the following, I get a parse error on the line where my first square brackets (...for " .member[1];) appears. If I take the square brackets out, the code parses, but does not do anything. Here is the problematic code: db_connect(); $query = "select * from tablename where active = 1"; $result = mysql_query($query); while ($member = mysql_fetch_row($result)); { $subject = "EigoImprov Newsletter for " .member[1]; $mailcontent = "Dear " .$member[0] .",\n".$message ."\nThis message was sent to [2]" .$member; mail($member[2], $subject, $mailcontent, $fromaddress); } Why is this not parsing? -- Cheers! Dave G ml@autotelic.com

« previous php.general (#168371) next »