Re: Re: echo?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 




On Mar 22, 2011, at 9:50 PM, Jim Giner wrote:

Yes - it is J and I.  I tried using $i+1 in the echo originally but it
wouldn't run.  That's why I created $j.

Interesting it wouldn't run.. perhaps that's a place to investigate?

And just what is wrong with the old cr/lf sequence? How would you have done
it?

If it is being sent to a browser, which i suspect given the html entities encoding, i would have used "<br />".

If it is being sent to a terminal or file, I would have used "\n".

What do you mean 'this alone .....'?

Merely that the construction I see shouldn't matter whether you use $j or $i+1.

"Tamara Temple" <tamouse.lists@xxxxxxxxx> wrote in message
news:521BDB9D-ADBF-45D7-B759-ACD315B196D2@xxxxxxxxxxxx

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



[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux