求一php写法!!

flylyke 2003-11-17 11:10:15

dim selected
selected=request.form("option")
sql="update research set select"&selected&"=select"&selected&"+1 where id=1"

这是asp中的写法。
php应该怎么写?
主要的问题是select"&selected&"=select"&selected&"+1 用php怎么写?
...全文
44 6 打赏 收藏 转发到动态 举报
写回复
用AI写文章
6 条回复
切换为时间正序
请发表友善的回复…
发表回复
programdolt 2003-11-18
  • 打赏
  • 举报
回复
$select=$_POST["option"];
$selectall="select".$select;
$sql="update research set $selectall= $selectall+1 where id=1";
$a=mysql_query($sql);
AgathaZ 2003-11-18
  • 打赏
  • 举报
回复
$select=$_POST["option"];
$sel="select".$select;
$aa=$select+1;
$sql="update research set ".$sel."=".$aa." where id=1";
$query=mysql_query($sql);
victoryall 2003-11-18
  • 打赏
  • 举报
回复
$select=$_POST["option"];
$selectall="select".$select;
$sql="update research set $selectall= $selectall+1 where id=1";
$a=mysql_query($sql);
victoryall 2003-11-17
  • 打赏
  • 举报
回复
$select=$_POST["option"];
$selectall="select".$select;
$sql="update research set '$selectall'= '$selectall'+1 where id=1";
$a=mysql_query($sql);
flylyke 2003-11-17
  • 打赏
  • 举报
回复
要update的字段是有三个:selectwin,selecttie,selectlost.
其中selected是我从提交的那页取过来的。他有三个值。分别是win,tie,lost.
我是根据不同的selected来update那三个字段.
所以在update的时候字段用select"&selected&".
也就是说update的一次,selectwin,selecttie或者selectlost加1
zhongmao 2003-11-17
  • 打赏
  • 举报
回复
你的SQL是什么意思呢?
让select=select + 1 吗?

21,886

社区成员

发帖
与我相关
我的任务
社区描述
从PHP安装配置,PHP入门,PHP基础到PHP应用
社区管理员
  • 基础编程社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧