The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
#1
|
||||
|
||||
Simple query help please
I've been wondering if I could do the following with a query, as opposed to using php.
I have two profile fields, `field1` and `field15` which each have strings within (or may be empty). What I want to do is pull the info from field1, and append it to that within field 15. This is quite simple to do via php & mysql, but is it at all possible to do with only a query? |
#2
|
||||
|
||||
if field1 = 'abc' and field2 = 'def'
Code:
select concat(field1, field2) as letters |
#3
|
||||
|
||||
thanks siradrian - perhaps I should have been clearer though, what I meant was doing it with one UPDATE query, in other words updating the actual database field15, not just selecting it
|
#4
|
|||
|
|||
That would be almost the same:
[sql]UPDATE table SET field15 = CONCAT(field1, field2) WHERE condition if needed [/sql] |
Thread Tools | |
Display Modes | |
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
More Information | |
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|