Tugger the SLUGger!SLUG Mailing List Archives

Re: [SLUG] PHP question..


On Sun, May 27, 2001 at 11:12:55AM +1000, Jeff Waugh wrote:
> <quote who="Chris Barnes">
> >       // Display the text of each joke in a paragraph
> >     while ( $row = mysql_fetch_array($result) ) {
> >       echo("<P>" . $row["JokeText"] . "</P>");
> >     }
> >
> > I would really like the site to display the ID field with the date next to
> > it, then on a new line the JokeText, then on a new line the JokeAuthor. I've
> > been playing around with it but i keep getting PHP Parse errors...
> 
> while ($row = mysql_fetch_array($result)) {
>     echo "<p>" . $row[ID] . " - " . $row[JokeDate] . "<br>\n"
>         . $row[JokeText] . "<br>\n"
>         . $row[JokeAuthor] . "</p>\n";
> }

I'm not a PHP person, but shouldn't that be $row["ID"], etc... (i.e.
with quotes)?

Or is PHP really that nasty?

-Andrew.