yup, this is an ad!
Napalm Riot Forums > Coding (non-game) > Need help updating a field in mySQL
Need help updating a field in mySQL
ɤInfog
Rushes With Zerg
I'm looking for a way to make this SQL work on a mySQL server:
In english:
UPDATE the table tags, SET the string in the field images to equal itself plus some text, WHERE the string in the field images does not contain that text already.
I'm used to using SQL in Visual Basic, where I have the luxury of creating and changing variables. I don't really know how to make it work purely in SQL.
The code is for my older brother, who is working on a simple social networking site. He's great at coding, not so great with databases.
Code:UPDATE tags SET images = (images & ",99") WHERE images <> "*,99*"
In english:
UPDATE the table tags, SET the string in the field images to equal itself plus some text, WHERE the string in the field images does not contain that text already.
I'm used to using SQL in Visual Basic, where I have the luxury of creating and changing variables. I don't really know how to make it work purely in SQL.
The code is for my older brother, who is working on a simple social networking site. He's great at coding, not so great with databases.
08.26.08 6:52 pm

ɤInfog (#24589)
Rushes With Zerg
ɤSkyrail (#24803)
Team Kills For A Living
Make love, and war.
ʊaapis (#24952)
Isn't my real name.
Ryan Priebe
UI & Graphic Designer
Napalm Riot Inc.
ӝCoolhand2 (#24958)
Kills People While They Type
Remember, the answer is always 42.
ʊaapis (#24965)
Isn't my real name.
Ryan Priebe
UI & Graphic Designer
Napalm Riot Inc.