Re: Retrieve data and column names from a table

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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>";
}

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


[Index of Archives]     [PHP Home]     [PHP Users]     [Postgresql Discussion]     [Kernel Newbies]     [Postgresql]     [Yosemite News]

  Powered by Linux