List:General Discussion« Previous MessageNext Message »
From:Martin Ramsch Date:September 12 1999 7:23pm
Subject:Re: [mySQL] beginners search engine layout
View as plain text  
On Sun, 1999-09-12 15:37:44 +0200, I wrote:
>     2b) Presenting the results of the query
[...]
>         if ( 0 == mysql_num_rows($rid) ) {
>           echo "Nothing found, please revise your search.<BR>\n";
>         }
>         else {
>           // fetch results row by row and display them.
>           while( $row = mysql_fetch_row($rid) ) {
                          ^^^^^^^^^^^^^^^
>             $title       = $row['title'];
>             $url         = $row['url'];
>             $description = $row['description'];
>             echo HtmlSpecialChars("$title, $url, $description")
>                  . "<BR>\n";
>           }
>         }

Stupid mistake: if I want to access the result fields by name, this
has to be mysql_fetch_array($rid)!  See PHP manual.

Regards,
  Martin
-- 
Martin Ramsch <m.ramsch@stripped> <URL: http://home.pages.de/~ramsch/ >
PGP KeyID=0xE8EF4F75 FiPr=52 44 5E F3 B0 B1 38 26  E4 EC 80 58 7B 31 3A D7
Thread
[mySQL] beginners search engine layoutd e l   d h a n o a12 Sep
  • Re: [mySQL] beginners search engine layoutMartin Ramsch12 Sep
    • Re: [mySQL] beginners search engine layoutMartin Ramsch12 Sep