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
to make those changes, the real values were contained in the
actual script. See following (earlier than your reply?) emails.

So blindfold me and shoot me for not taking the time to edit that
bit of punctuation that was sent to the list, I asked for help on
the loop and not help on connecting to the db. Oh, so shoot me for
posting too much code, basically. I'm guilty as hell on that.

In the actual test I tried after sending that email, probably I
left a set of quotes in somewhere, I can't find any reserved word
conflicts. Other replies indicate that it should work as intended,
so probably I'll try it again.

if (!$link) {
     die('Unable to connect : ' . mysql_error());

Forget the loop, this should have puked right here, or you aren't
posting your actual code...

It was the actual code, edited for certain authentication data that
is already identified elsewhere.

phpinfo() says PHP v4.3.11 and MySQL v3.23.32 so why didn't it puke
right there and why should it have?

Please tell me, I need to learn more about these versions I must
deal with too.

//get column data
        $sql    = "SELECT column2, column3 FROM $table";
        $result = mysql_query($sql);
        $row = mysql_fetch_row($result);

//loop through to display results
for($i=0; $i < count($row); $i++){

The $row only has TWO columns in it: column2, column3

Right. And?

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.

Aside, does everyone else think you are a butthead or are we off
to a bad start? Let's fix that, can we?

Ulex

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to