Re: Strange error on mysql_fetch_array

From: Date: Wed, 27 Jun 2001 09:23:48 +0000
Subject: Re: Strange error on mysql_fetch_array
References: 1 2  Groups: php.general 
Request: Send a blank email to php-general+get-55363@lists.php.net to get a copy of this message
In article <046401c0fee3$a6c789e0$6401a8c0@Lynchux100>, ceo@l-i-e.com ("Richard Lynch") wrote: > > $result_id = @mysql_query("DESC $table_name $field_name"); > > I don't think "DESC $table_name $field_name" is valid SQL, is it?... > > DESC is DESCENDING in an ORDER BY clause... > > Perhaps if you used DESCRIBE?... Is that what you are doing?... DESC {table name} [{field name}] is a valid expression in MySQL. It's a synonym for the DESCRIBE keyword. Though the query could still be failing for any number of reasons (invalid table name, invalid field name, older version of MySQL that doesn't support that syntax, etc.). Throw in die(), mysql_error(), $php_errormsg; turn down error_reporting, and/or turn off display_errors...anything but using the @ sign by itself (a surefire way to never clue in to much stuff is silently going wrong). -- CC

« previous php.general (#55363) next »