printing an array

From: Date: Thu, 24 Oct 2002 08:07:30 +0000
Subject: printing an array
Groups: php.db php.general 
Request: Send a blank email to php-db+get-22646@lists.php.net to get a copy of this message
Hey there all Im sure that someone out there can answer this question.. I have a problem, how can I print each element in an array so that is returned into a table? eg <table width="100%" <th width="25%" nowrap> Test1 </th> <th width="25% nowrap> Test2 </th> <th width="25% nowrap> Test3 </th> <th width="25%"> Test4 </th> <?php include("common.inc"); $link_id = mysql_connect($dbhost, $username, $password) or die ("Connection Failed"); mysql_select_db($db); $query = "select Routine_Tests_Count from CDT_Routine_Tests where Ref_num = '$ref_num' order by Routine_Tests_Link; $result = mysql_query($query, $link_id) or die ("Query on $dbhost failed); while ($row = mysql_fetch_object($result)) { print "<td>$row->CDT_Routine_Count</td>"; <--------------- (This value holds the Results of test1 test 2 etc that I need to print into the table) } mysql_free_result($result); ?> </table> Any help with this or direction would be appreciated ! Regards Chris -------------------------------------- Chris Grigor --------------------------------------

« previous php.db (#22646) next »