![]() |
if table exists?
whats the php code, for
'If this table exists... do this'? |
CREATE TABLE IF NOT EXISTS `table_name`
IF NOT, IF |
what if its not a table? i need to make a coloum in the user table
|
ALTER TABLE IF EXISTS `table_name` ADD `column_name`...
|
PHP Code:
|
To test if a column exists, you cna use the following query:
[sql]SHOW COLUMNS FROM <tablename> WHERE field = '<columnname>';[/sql] Alternative you could disable error reporting and just run the query to add the column. |
could i have the exact code? i need to add a feild to the 'user' table, called 'xtreme_top_100' and thats it
|
turn off error reporting:
PHP Code:
|
lol :P
and thanks ^^ |
All times are GMT. The time now is 08:57 PM. |
Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
![]() |
|
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|