RE: [PHP] PHP function for listing number of columns in table

2002-06-10 Thread Tim Ward
Just off the top of my head wouldn't describe then mysql_num_rows() be a lot more efficient. Tim Ward www.chessish.com http://www.chessish.com [EMAIL PROTECTED] mailto:[EMAIL PROTECTED] -- From: John Holmes [SMTP:[EMAIL PROTECTED]] Sent: 09 June 2002 18:29

RE: [PHP] PHP function for listing number of columns in table

2002-06-10 Thread Mark
yes, I think getting the result set for 'describe $table' or 'show fields from $table' and then doing mysql_num_rows() on that is best because it will return right away and will work for empty tables as well. On Mon, 10 Jun 2002 09:00:41 +0100, Tim Ward wrote: Just off the top of my head

Re: [PHP] PHP function for listing number of columns in table

2002-06-10 Thread hugh danaher
what's the matter with using mssql_num_fields() and get the answer directly. $fields = mysql_list_fields($db, $table, $link); $columns = mysql_num_fields($fields); Hugh - Original Message - From: Mark [EMAIL PROTECTED] To: [EMAIL PROTECTED]; [EMAIL PROTECTED]; [EMAIL PROTECTED]; John

RE: [PHP] PHP function for listing number of columns in table

2002-06-09 Thread John Holmes
No. There is, however, a function that'll tell you how many columns are in a result set. So, if you select all columns, then you can use that function to find out how many columns are in the table. www.php.net/mysql_num_fields ---John Holmes... -Original Message- From: [EMAIL

Re: [PHP] PHP function for listing number of columns in table

2002-06-08 Thread hugh danaher
try mysql_num_fields() Hugh - Original Message - From: [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Saturday, June 08, 2002 9:54 PM Subject: [PHP] PHP function for listing number of columns in table Pardon the probably stupid question but, Is there a PHP function for listing number