Re: Re: echo?

From: Date: Wed, 23 Mar 2011 02:40:08 +0000
Subject: Re: Re: echo?
References: 1 2 3  Groups: php.general 
Request: Send a blank email to php-general+get-311992@lists.php.net to get a copy of this message
On Mar 22, 2011, at 8:42 PM, Jim Giner wrote:
ok - here's the code in question. $q = 'select * from director_records '; $qrslt = mysql_query($q); $rows = mysql_num_rows($qrslt); for ($i=0; $i<$rows; $i++) { $j = $i+1;
Am i reading this correctly: the first variable is j (jay) the second variable is i (eye) ? This alone doesn't explain anything...
$row = mysql_fetch_array($qrslt); echo $j.'-'.$row['userid'];
Since this is the only place $j is used, try subbing in $i+1 and see what you get.
if ($row['user_priv']<> "")
       echo ' ('.$row['user_priv'].')&#13&#10';
This is really rather a strange way of getting a line break.
else
       echo '&#13&#10';
} The output I get is: 1-smith5 f-ginerjm (M) g-smith8 While the alpha parts are valid, the index is only correct for the first one (0) obviously. --PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php


« previous php.general (#311992) next »