Nathaniel Wendt
Nathaniel Wendt

Reputation: 1202

SQL UPDATE question for large fields

So I have a table with a field that I wish to work with in a mySQL database. It's function is a long list of keywords used for fulltext search so the field is rather long.

For example:

Table
'data_index'
shirt t-shirt list item red black brown green purple sleeveless...etc for about 20 lines

I would like to match a separate string, lets define as:

$string  = "teeshirt shert shertt shirtt";

I would like to ADD these items in $string to the list without having to grab the entire value in each data_index field. Essentially I don't want to have to use the UPDATE sql command and use the entire data_index value in this query. Is this possible?

Upvotes: 0

Views: 61

Answers (1)

Dan Grossman
Dan Grossman

Reputation: 52372

UPDATE tablename SET data_index = CONCAT(data_index, 'your new keywords') WHERE ...

Upvotes: 2

Related Questions