"toby -" <[EMAIL PROTECTED]> wrote on 09.07.2002 11:35:40:
Hi Toby,
>
>hi guys
>
>im trying to retrieve 5 record each page from my db
>
>my code iz :
>
>
>$query_nme = "SELECT firstName, lastName, title, summary FROM ctnt_inf
^^
I think you should include "id," to get the row id
>where ctnt_id ORDER BY RAND() LIMIT 5";
> $query_result_handle_nme = mysql_query ($query_nme)
> or die ('qry failed ! DA tbl must xixt in DA db specifyd bov ....');
>
>
>
>echo("<p><font align=RIGHT>");
>
> for ($cnt=0; $cnt<=5; ++$cnt ) {
>
> $row_nme = mysql_fetch_row ($query_result_handle_nme);
> echo ("<br><br>");
>
> $tID = $row_id[0];
^^^^^^^^^^
If you include id in the query this should read $row_nme[0]
> $tName = $row_nme[0];
^^^^^^^^^^
If you include id in the query this should read $row_nme[1]
You can retrieve the other fields by using an increasing index (i.e.
$row_nme[2], $row_nme[3]...)
> echo ( $tID );
> echo ( $tName );
>
> } // echo ("<br><br>");
>
> echo("</font></p>");
>
>
>problem:
>it only displays firstName n nothing else .... though 5 random first names
>but
>i guess i'll ve to make seperate query fo each field in the table
>or will i ????
>
>
>
>thnx a million .....
>
>toby .....
Bye Oliver
--
Good programming is 40% experience, 30% skill, 20% RTFM, 10% caffeine, and 5%
attention to detail.
Oliver Six, CEO
CAHOS GmbH, Cimbernstr. 51, Germany 81377 Muenchen
Phone +49 89 71 01 93 41, Fax +49 89 71 01 93 42
---------------------------------------------------------------------
Before posting, please check:
http://www.mysql.com/manual.php (the manual)
http://lists.mysql.com/ (the list archive)
To request this thread, e-mail <[EMAIL PROTECTED]>
To unsubscribe, e-mail <[EMAIL PROTECTED]>
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php