Richard Lynch wrote:
The $result may have many, many, many rows in it.
You can find out HOW many by using:
http://php.net/mysql_num_rows
This has already been resolved, but I'd like to learn what I can
from you re: your earlier comments, above.
Your take-home should not be that switching from
Jochem Maas wrote:
there is no 'we' in 'you'.
There's no "Jochem" in there either. No offense taken, btw.
Richard's posted more answers to more
posts on this list than you have written line of code in your life
...probably.
And yet. No, I'm not going to say what happened elsewhere, to you
Richard Lynch wrote:
$link = mysql_pconnect('$host', '$login', '$passwd');
'$host' is not right.
$host is right.
Ditto for ALL your values throughout this script.
I know. I knew. I knew that variables do not need quotes, that
single quoted variables get parsed literally. I edited the email
Steve Edberg wrote:
As far as displaying only the first row, that's because you're only
fetching the first row; count($row) in your for loop will always
evaluate to 0 (if there are no results) or 1. You need to move the
mysql_fetch_row() call into your loop; something like
$result = mysq
Jochem Maas wrote:
side note: where does $table come from?
I didn't want to reveal the real names of my server/host, table,
login or password to the list, so I tried setting $host, $login,
$passwd, and $table variables at the top of the script. That way
it's 4 lines to omit when posting code,
T.Lensselink wrote:
Can you show some code?
Apparently I sent replies to T.Lensselink only, here's the meat of
the 2nd one:
--
Actually, it doesn't exactly iterate the 1st row 4 times, it's a bit
more convoluted.
The table fas 4 columns (Fields):
1 - int, primary, auto-incrementer
2 - varch
It's pretty much the same. With var_dump(), values from the first row
of the table are iterated twice, the script is not looping through and
reporting all 2100 rows. Grossly similar behavior was observed with
print_r() and echo: while different data was reported by each, the
loop wouldn't loop. Th
Jochem Maas wrote:
you also mentioned you changed the code when trying to test it on another
machine - don't do that, test one thing at a time.
I'm not the original poster, that wasn't me.
anyway problem solved, preventative knowledge aquired, onto the next
hurdle :-)
I'm having some trou
Jochem Maas wrote:
?>
...
to avoid this in future never add the closing php bracket to the end of
the php file (unless you explicitly want to output something after the
code in question - which is almost never the case), it is not required.
e.g.
- >8 info.php
8 info.p
9 matches
Mail list logo