【问题标题】:i don't now, why i have error in this sql request [duplicate]我现在不知道,为什么我在这个 sql 请求中有错误 [重复]
【发布时间】:2018-12-14 07:48:49
【问题描述】:
UPDATE `vjprf_jshopping_manufacturers` 
SET `meta_title_en-GB`='Buy products from the manufacturer '.`name_en-GB`.' 
in Ukraine at wholesale prices | Deps' WHERE `manufacturer_id`=3

我需要在meta_title_en-GB='some text (place to insert name_en-GB) some text'中插入name_en-GB

错误编号 #1064

【问题讨论】:

  • 请添加一些关于你的代码的解释...同时显示你得到的错误
  • 请提供您遇到的错误。
  • 我需要在'meta_title_en-GB'='some text (place to insert name_en-GB) some text'中插入name_en-GB
  • 错误号#1064
  • 反引号和单引号混淆了?

标签: mysql sql


【解决方案1】:

点用于 PHP 中的字符串连接。在 MySQL 中使用CONCAT 函数:

UPDATE vjprf_jshopping_manufacturers
SET meta_title_en-GB = CONCAT('Buy products from the manufacturer ', name_en-GB,
    ' in Ukraine at wholesale prices | Deps')
WHERE
    manufacturer_id = 3;

【讨论】:

    猜你喜欢
    • 2020-02-14
    • 1970-01-01
    • 2021-05-11
    • 2020-01-14
    • 2019-06-22
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多