|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
How can I check if a table exists...
I want to check if a table exists before i try to access it. Can anyone help me?
Thanks |
|
#2
|
|||
|
|||
|
RE: How can I check if a table exists...
Are you looking to check this in php? Here is something I use to check for the existence of a table using php and mysql....
$table_exist = 0; while (list($tablename)=mysql_fetch_array($tables)) { if($tablename == 'yourtable') { $table_exist = 1; } } if($table_exist == 0) { //do something if it does not exist } else { //do something if it does exist } |
|
#3
|
|||
|
|||
|
RE: How can I check if a table exists...
You can also access this info with an SQL query.
For example, MS SQL Server has the metatable sysobjects. quick hint: SELECT * FROM sysobjects WHERE name = 'TableName' |
![]() |
| Viewing: Codewalkers Forums > Other Technologies > Database Help > How can I check if a table exists... |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|
|
|
|
|