开发者

What is the problem with my sql query?

What is the prob开发者_Go百科lem with my sql query ?

UPDATE template SET template = template . "hello"


Concatenation in MySQL uses a + i believe, not a . (that's php). Alternatively, you could use CONCAT:

UPDATE template SET template=CONCAT(template,'hello');


Where are you making this query? If it's just in MySQL, they don't use . as the concatenation operator like PHP does. Look into CONCAT instead if this is just a SQL query.

It's unclear from your question and your tags whether or not we should help you with PHP syntax or MySQL's SQL syntax.


UPDATE template SET template = template . "hello"

update tablename
set fieldname=new field value

[1] template is a table name or field name? if fieldname then you have to use below syntex:

**update tablename
set template = concat(template,'.', 'hello')**


If all you want to do is replace all of the rows in template to = "hello" then

UPDATE template 
SET template = 'hello'

(Edit replaced quotes with single quotes)

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜