Re: V basic newbie problem
| From: | Erik Price | Date: | Wed, 03 Jul 2002 15:01:54 +0000 |
| Subject: | Re: V basic newbie problem | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-105214@lists.php.net to get a copy of this message | ||
On Wednesday, July 3, 2002, at 10:43 AM, Duncan Ellwood wrote:
My problem arises when I want to fill in the subsequent rows of the table with the subesquent rows from the database. How do I create the recordset that will pull the info from the relevant subsequent rows for my columns? The code for the first row and first column entry is: <?php echo $row_RsSingStanDailybb['DailyBB']; ?> but in the row below in the html table I want to refer to the second row DB entry for DailyBB but I cant see how to go about this:( The Repeat server behaviour in DW Mx simply puts all the values in one html cell which is not what I wish to achieve. Basically I want the html table to match the database but have only succeeded in getting the first row to display so far:(I haven't used DW Mx myself, I don't really like WYSIWYGs. But the way to do it is use a while loop. // $db = your connection parameters // $sql = your query if (!$result = mysql_query($sql, $db)) { die('The query failed for some reason'); } // this part goes through all the data in $result // and does something with that data on each iteration while ($row = mysql_fetch_assoc($result)) { echo $row_RsSingStanDailybb['DailyBB']; } Erik ---- Erik Price Web Developer Temp Media Lab, H.H. Brown pricee@hhbrown.com