Re: [PHP-DB] Retrieve data and column names from a table

2003-12-17 Thread Tobey Wheelock
On Wed, Dec 17, 2003 at 07:43:50PM -, 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";
}

-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP-DB] Retrieve data and column names from a table

2003-12-17 Thread Shaun
Hi,

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'

How can I get PHP to show the data and the column names? With reference to
my earlier post and the replies I can't use DESCRIBE in conjunction with
SELECT and I don't want to use a deprecated PHP function...

Thanks for your help

-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php