The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
#1
|
||||
|
||||
Need to check for a column in a table
I'm doing an addon and I an install plugin I need to do the following in a mySQL query or a series of queries.
Psuedocode: add a new column check for an existing column from an old version of the addon. If the old column exists Move the data for all records to the new column Anyone know if this is possible and if so how would I go about it? |
#2
|
|||
|
|||
Haven't tested it but this should work, just put it in your product xml install code and replace with the real variables.
PHP Code:
|
#3
|
||||
|
||||
Thanks! This looks a bit easier than what I was originally toying with. I was trying to do it with a table join to itself in an update query.
Something like: UPDATE TABLE_NAME as T2 SET t2.NEW_COLUMN = t1.OLD_COLUMN INNER JOIN TABLE_NAME T1 ON T2.UserID = T1.UserID WHERE T2.UserID = @UserID I just wasn't able to figure out how to loop it to get the userid. |
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
More Information | |
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|