作者coilion9670 (runrunder)
看板PHP
标题Re: [请益] array用POST传值
时间Fri Jun 6 20:58:11 2014
原文恕删
刚刚看了留言贴的文章
立马写了这一个"好阅读"的mysql_real_escape_string方法练习看看
但似乎不如我预期
for(n=0;n<10;n++){
$sql= sprintf("insert into table (student_id, name, memo)
values ('%s', '%s', '%s')",
mysql_real_escape_string($student_id[$n]),
mysql_real_escape_string($name[$n]),
mysql_real_escape_string($memo[$n])
);
}
mysql_query($sql);
我哪里会错意失败了...QQ 一直撞壁有错误请鞭
--
※ 发信站: 批踢踢实业坊(ptt.cc), 来自: 112.105.52.20
※ 文章网址: http://webptt.com/cn.aspx?n=bbs/PHP/M.1402059493.A.2A1.html
※ 编辑: coilion9670 (112.105.52.20), 06/06/2014 23:36:30
※ 编辑: coilion9670 (112.105.52.20), 06/06/2014 23:37:56
1F:→ noxhsu:不要在不知道时自己设值,要不是去做count,不然foreach 06/07 00:21
2F:→ noxhsu:还有你的code在环境上与提问时请保持同步,没人可以猜的出 06/07 00:24
3F:→ noxhsu:你的问题到底在哪,如果还是以现在这种提问方式 06/07 00:26
4F:→ coilion9670:好的...我会再思考与改进... 06/07 00:30