Re: MySQL depreciated mysql_list_* commands: Replacements?
| From: | Peter Beckman | Date: | Wed, 10 Sep 2003 20:10:21 +0000 |
| Subject: | Re: MySQL depreciated mysql_list_* commands: Replacements? | ||
| References: | 1 | Groups: | php.db |
| Request: | Send a blank email to php-db+get-30449@lists.php.net to get a copy of this message | ||
On Wed, 10 Sep 2003, Peter Beckman wrote:
> Then mysql_list_fields didn't work right. So I submitted a bug
> (http://bugs.php.net/bug.php?id=25460) about it, and they said IT TOO was
> depreciated, which is fine. But I haven't figured out how to replace
> mysql_list_fields with a nice simple SQL command, since a bunch of code
> relies on mysql_list_fields to return a nice $result (ie Resource #37) to
> use with mysql_field_flags, mysql_field_name, etc.
Figured it out:
replace: $result = mysql_list_fields($db, $table [, $link])
with: $result = mysql_query("SELECT * FROM ".$db.".".$table." LIMIT
1" [, $link])
Works with mysql_field_* functions (at least it seems to) correctly.
Since mysql_list_fields is now depreciated, you might want to check your
code out soon/now to make sure you don't get screwed when the PHP team
takes mysql_list_fields out of PHP entirely.
Don't you love it when you figure out your own question?
Beckman
---------------------------------------------------------------------------
Peter Beckman Internet Guy
beckman@purplecow.com http://www.purplecow.com/
---------------------------------------------------------------------------