The "select * from [tablename]" approach for MS SQL may be problematic if you have very large tables even if you only return one row. You don't have an accessible index for "select *". It also gives you no information about table data types. That's why I suggested using a "select [name] from syscolumns where id = [your_table_id]". If you are using MS SQL, you've already made a platform choice (or had it jammed down your throat), and I don't believe that one select statement determines portability. It all depends on your requirements.
Dave -----Original Message----- From: Brad Thomas [mailto:[EMAIL PROTECTED]] Sent: Friday, August 16, 2002 9:35 PM To: [EMAIL PROTECTED] Subject: [PHP-WIN] Re: Getting Field Names in Microsoft SQL "R.S. Herhuth" <[EMAIL PROTECTED]> wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... > > I'm trying to build a dynamic script that basically extracts all of the > fields in a MS SQL database...I just can't seem to figure out how to get > at the field names themselves. I am using the mssql_fetch_array > followed by the $row['field_name'] in an array. But I would like to > make the field_name dynamic (i.e. not knowing the field_names ahead of > time) which would make the script adaptable to any table in the > database. So if I get the field's value by $row['field_name'] how do I > get at the field's name? > > thanks, > Ron -- PHP Windows Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php