The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
#1
|
|||
|
|||
![]()
i'm trying to use a "IF NOT EXISTS" with a install code but i couldn't
could someone correct this for me? thx $db->query_write("ALTER TABLE accounts ADD group_id IF NOT EXISTS INT(11) NOT NULL COMMENT 'accounts group' AFTER password"); the error Code:
Database error in vBulletin 3.6.8: Invalid SQL: ALTER TABLE accounts ADD group_id IF NOT EXISTS INT(11) NOT NULL COMMENT 'accounts group' AFTER password; MySQL Error : You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'IF NOT EXISTS INT(11) NOT NULL COMMENT 'accounts group' AFTER password' at line 1 Error Number : 1064 |
#2
|
||||
|
||||
![]()
You can't directly use the IF NOT EXISTS method on column additions.
|
#3
|
||||
|
||||
![]()
Use the db alter class, disable database errors before doing the query, or do another query to see if the column exists.
|
#4
|
|||
|
|||
![]()
thanks Dismounted and SirAdrian i'll give a try!
|
![]() |
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
![]() |
|
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|