note 19040 deleted from control-structures.foreach by philip

From: Date: Mon, 30 Dec 2002 17:46:53 +0000
Subject: note 19040 deleted from control-structures.foreach by philip
References: 1  Groups: php.notes 
Request: Send a blank email to php-notes+get-41479@lists.php.net to get a copy of this message
I've tried various ways to pull out data and simply displaying it on my browser -->for example: for each thing in array write thing --------------------- <? $conn = pg_pconnect ("dbname=mydatabase"); $result = pg_exec ($conn, "select * from pamtest"); $numfields = pg_numfields ($result); $numrows = pg_numrows ($result); For ($i = 0; $i < $numfields ; $i++){ printf("<th bgcolor='silver'>%s</th>", pg_fieldname ($result,$i)); } print "</tr>\n"; For ($i=0; $i < $numrows; $i++){ $array = pg_fetch_row($result,$i); print "<tr>\n"; Foreach($array as $value){ echo "<td>".$value."</td>\n"; } print "</tr>\n"; } ?> Hope this helps someone.

« previous php.notes (#41479) next »