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
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
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
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
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
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
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 :)
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,
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
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
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
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
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
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
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
17 matches
Mail list logo