gpt4 book ai didi

php - 更新 php 中的多列

转载 作者:行者123 更新时间:2023-11-29 08:57:17 25 4
gpt4 key购买 nike

我有以下查询:

$sql="UPDATE streams SET name='$name', limit='$limit', desc='$desc' WHERE id='$id'";

当我运行此命令时,出现以下错误:

You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'limit='15', desc='dsfds' WHERE id='14'' at line 1

我哪里出错了?我一直在尝试不同的选择,但我并没有真正取得任何进展。

最佳答案

我认为你必须转义你的限制(和描述)列,它是一个保留关键字

$sql="UPDATE streams SET `name`='$name', `limit`='$limit', `desc`='$desc' WHERE `id`='$id'";

关于php - 更新 php 中的多列,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/9636036/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com