Re: [PHP] var_dump() results

2008-01-14 Thread Europus
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

Re: [PHP] var_dump() results

2008-01-14 Thread Europus
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

Re: [PHP] var_dump() results

2008-01-14 Thread Richard Lynch
On Mon, January 14, 2008 12:21 pm, Europus wrote: > 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

Re: [PHP] var_dump() results

2008-01-14 Thread Jochem Maas
Europus schreef: Richard Lynch wrote: ... Aside, does everyone else think you are a butthead or are we off to a bad start? Let's fix that, can we? there is no 'we' in 'you'. Richard's posted more answers to more posts on this list than you have written line of code in your life ...probabl

Re: [PHP] var_dump() results

2008-01-14 Thread Europus
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

Re: [PHP] var_dump() results

2008-01-14 Thread Richard Lynch
On Sun, January 13, 2008 11:32 am, Europus wrote: > 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 differ

Re: [PHP] var_dump() results

2008-01-13 Thread Jim Lucas
Europus wrote: 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 whe

Re: [PHP] var_dump() results

2008-01-13 Thread Chris
or you could do $result = mysql_query($sql); $count = mysql_num_rows($result); for ($i=0; $i<$count; $i++) { var_dump($row); ... } Not unless you have a $row = mysql_fetch_assoc($result); before doing the var_dump of $row because $row isn't being set :)

Re: [PHP] var_dump() results

2008-01-13 Thread Europus
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

Re: [PHP] var_dump() results

2008-01-13 Thread Europus
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,

Re: [PHP] var_dump() results

2008-01-13 Thread T.Lensselink
Europus wrote: Actually, it doesn't exactly iterate the 1st row 4 times, it's a bit more convoluted. The table as 4 columns: 1 - int, primary, auto-incrementer 2 - varchar() values 3 - varchar() values 4 - varchar() values and 2100 rows. The return is 4 rows of this: array(4) { [0]=> stri

Re: [PHP] var_dump() results

2008-01-13 Thread Steve Edberg
At 12:32 PM -0500 1/13/08, Europus wrote: 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 r

Re: [PHP] var_dump() results

2008-01-13 Thread Europus
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

Re: [PHP] var_dump() results

2008-01-13 Thread Jochem Maas
Europus schreef: 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

Re: [PHP] var_dump() results

2008-01-13 Thread T.Lensselink
Europus wrote: T.Lensselink wrote: It doesn't loop through all rows because you use mysql_fetch_row. Wich does exactly what it's name tells you. It fetches one single row. Doh! Yes I'm brand new at PHP, though I've been doing HTML/CSS forever. That doesn't seem to mean much to a PHP/MySQL ins

Re: [PHP] var_dump() results

2008-01-13 Thread T.Lensselink
Europus wrote: 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 w

[PHP] var_dump() results

2008-01-13 Thread Europus
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