Re: Really embarassing newbie question...
| From: | Kelvin | Date: | Fri, 27 Apr 2001 13:57:56 +0000 |
| Subject: | Re: Really embarassing newbie question... | ||
| References: | 1 | Groups: | php.db |
| Request: | Send a blank email to php-db+get-8943@lists.php.net to get a copy of this message | ||
Hi,
Use this:
$query="describe TableName";
$result=mysql_query($query) or die (mysql_error());
This is one good way to prevent update or delete or mass up the table
without known.
Kelvin.
""~BD~"" <bd@bustdustr.net> wrote in message
news:02a601c0ced3$34cdd5a0$22041dd8@winbox...
> Sorry to do this to ya...
> I"ve been involved with PHP for a total of two days now, and I'm kinda
> stumped. I've been looking in docs for about 4 hours now for this, and I'm
> sure I'm slipping right by the obvious answer somewhere, but....
>
> What's the best (recommended) way to determine if a table exists in a
> database? Is it to try a query on it, and check the returned error? that's
> the way I'm set up now, but I can't help but think there's got to be a
> better way...
>
> TIA,
> ~BD~
>
>
>
> http://www.bustdustr.net
> Home of Radio Free Bd
>
>
>
> --
> PHP Database Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: php-db-unsubscribe@lists.php.net
> For additional commands, e-mail: php-db-help@lists.php.net
> To contact the list administrators, e-mail: php-list-admin@lists.php.net
>