Re: Retrieve data and column names from a table

From: Date: Wed, 17 Dec 2003 20:28:04 +0000
Subject: Re: Retrieve data and column names from a table
References: 1  Groups: php.db 
Request: Send a blank email to php-db+get-32108@lists.php.net to get a copy of this message
On Wed, Dec 17, 2003 at 07:43:50PM -0000, Shaun wrote: > I need to retrieve the data and column names from a single row in a table, > i.e. 'SELECT * FROM Table WHERE Field_ID = 1' Maybe something like this: $result = mysql_query ("SELECT * FROM Table LIMIT 1",$db); $my_row = mysql_fetch_array ($result, MYSQL_ASSOC); foreach ( $my_row as $key => $value ) { echo "$key: $value<br>"; }

« previous php.db (#32108) next »