Re: MySQL depreciated mysql_list_* commands: Replacements?
| From: | Micah Stevens | Date: | Wed, 10 Sep 2003 19:39:24 +0000 |
| Subject: | Re: MySQL depreciated mysql_list_* commands: Replacements? | ||
| References: | 1 | Groups: | php.db |
| Request: | Send a blank email to php-db+get-30447@lists.php.net to get a copy of this message | ||
You have a couple of choices if I remember correctly.. For a table of name
'TBL':
describe TBL;
explain TBL;
show columns from TBL;
-Micah
On Wed September 10 2003 12:08 pm, Peter Beckman wrote:
> So PHP is saying mysql_list_tables is depreciated. I replaced it with
> mysql_query("SHOW TABLES FROM DB") and everything is fine.
>
> 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.
>
> Anyone got any ideas on how to do that without replacing mysql_field_flags
> et al? Or do I have to rewrite the code entirely to use "SHOW FIELDS FROM
> DB.TABLE" and rewrite my own _field_ functions?
>
> Beckman
> ---------------------------------------------------------------------------
> Peter Beckman Internet Guy
> beckman@purplecow.com
> http://www.purplecow.com/
> ---------------------------------------------------------------------------