The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
#1
|
|||
|
|||
Table update function
Ok I have this function:
PHP Code:
Thanks Steve |
#2
|
|||
|
|||
Is this using vBulletin back-end? If so make sure you read this: Using the vBulletin Input Cleaner, before you go any further in reading my post.
To store an array in a database row you need to serialize it in a string. See the PHP manual for information on serialize() and unserialize(). An example: PHP Code:
|
#3
|
||||
|
||||
What you want is a CASE statement.
[sql]UPDATE table SET set_value = CASE WHEN set_varname = 'X' THEN $value_for_x WHEN set_varname = 'Y' THEN $value_for_y END WHERE set_varname IN ('X', 'Y')[/sql] |
#4
|
|||
|
|||
Oh whoops I didn't see all of your query Steve M. My apologies. :erm:
|
Thread Tools | |
Display Modes | |
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
More Information | |
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|