This is a discussion on "fastest way to check if table exists" within the PHP Forum section. This forum, and the thread "fastest way to check if table exists are both part of the Program Your Website category.
|
|
|
|
|
![]() |
||
fastest way to check if table exists
|
||
| Notices |
![]() |
|
|
LinkBack | Thread Tools |
|
||||
|
fastest way to check if table exists
whats the fastest way with PHP to check if a MySQL table really exists?
__________________
echo "Take it easy, ".$CloudedVision; .links { site: other-road-design; blog: only-nerds-allowed; project: resource-fish; organization: ARMIES6; } <quote>"I think it's wrong that only one company makes the game Monopoly" - <name>Steven Wright</name></quote>
Last Blog Entry: Nerd Poster (Jun 2nd, 2008)
|
|
|
|
|||
|
Re: fastest way to check if table exists
How about doing: 'describe table_name;' ?
If it exists, you'll get some result. It's better than doing a select on the table because the select may return 0 results if the table exists but is empty and/or corrupt. |
|
|||
|
Re: fastest way to check if table exists
Quote:
show tables like 'your_table_name' if it returns 1 rows => then your table exists. |
|
||||
|
Re: fastest way to check if table exists
I think this would be the method I would use.
__________________
Rob - SEO Specialist Owner & Founder of Webforumz.com I am currently unavailable for private work
Last Blog Entry: Creative Labs threaten developer over home made drivers.... (Apr 1st, 2008)
|
![]() |
| Thread Tools | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Check to see if a cfwindow exists | BenR41 | Other Programming Languages | 0 | Feb 25th, 2008 12:22 |
| simple check if user exists | mlecho | PHP Forum | 3 | Aug 28th, 2007 15:48 |
| The Best and Fastest Method For Rounded Corner Designs | sinjix_media | Web Page Design | 1 | Jun 7th, 2007 15:38 |
| Check whether URL exists | Sheepymot | PHP Forum | 2 | Jul 24th, 2005 08:16 |
| Fastest way to dump a table contents? | u2orange | Databases | 6 | Mar 1st, 2004 20:43 |