display multiple records in a page using include or require in php
Posted by: ryanpaul_04 (---.53.228.20.pldt.net)
Date: April 03, 2008 01:06PM

can someone help me how to display multiple records from different table in mysql??...by the way i'm using the include function in php to view a record from a different page..is there another way rather than mysql_fetch_array to get the records??..

can i do this??
sample:

$result1 = mysql_query("SELECT * FROM dbName1"winking smiley;
$result2 = mysql_query("SELECT * FROM dbName2"winking smiley;

while($row1 = mysql_fetch_array($result1))
{
//statement here
}

while($row2 = mysql_fetch_array($result2))
{
//statement here
}

Options: ReplyQuote
Re: display multiple records in a page using include or require in php
Posted by: toivo (---.nsw.bigpond.net.au)
Date: April 04, 2008 04:26PM

Hi,

If you want to display multiple rows from different tables, usually the tables are related by key fields and you can use the JOIN statement, see examples in the MySQL Reference Manual at [dev.mysql.com].

The include() function in PHP does not access your database but includes and evaluates a file containing PHP source code.

Other mysql_ or mysqli_ commands are mysql_fetch_row and mysql_fetch_object.

And your code looks all right.

Regards,

toivo
Sydney, Australia

Options: ReplyQuote
Re: display multiple records in a page using include or require in php
Posted by: ryanpaul_04 (---.53.225.53.pldt.net)
Date: April 05, 2008 03:19AM

thanks for the reply toivo...i'll try this one.

Options: ReplyQuote


Sorry, only registered users may post in this forum.