Forum Moderators: coopster

Message Too Old, No Replies

Repeating a region based on multiple queries

what if different table cells pull data from different queries?

         

stuckinbed

2:52 am on Jul 12, 2005 (gmt 0)

10+ Year Member



Greetings!

I have created two mysql queries. The result from one query is echoed in one column of a table and the result from the other query is echoed in the next column. These table cells repeat through a loop so that they display all records.

However, because I am using TWO queries, I have no clue how to loop the region.

I am using dreamweaver's standard 'repeat region' behavior, which obviously isn't going to work because my repeated region relies on two recordsets:

<?php do {?>
<tr><td><?php echo $row_rs_msg_data['topic_id'];?></td></tr>
<?php } while ($row_rs_msg_data = mysql_fetch_assoc($rs_msg_data));?>

Any help will be much appreciated!

stuckinbed

1:35 am on Jul 13, 2005 (gmt 0)

10+ Year Member



If anybody's interested, i solved my own problem... using mysql's TEMPORARY TABLES :-)

coopster

10:40 am on Jul 13, 2005 (gmt 0)

WebmasterWorld Administrator 10+ Year Member



Usually when you are displaying tabular data like this the information is somehow related. If that is the case you might be able to JOIN the tables and run one query as opposed to two. Didn't know if you had considered that or not yet ...

By the way, welcome to WebmasterWorld stuckinbed.