php中sql怎么拼接啊!我看到一些sql语句很懵懂,比如下面这个例子:
"update " .TABLE_NEWS_ARTICLES. " set news_status = '0', news_last_modified = now() where article_id = '" . (int)$article_id . "'"
最后一段'" . (int)$article_id . "'" 怪怪的,好像没有规律,我想实现多个参数的拼接这么实现,看得头都大了,哪位大哥指点指点.
"update " .TABLE_NEWS_ARTICLES. " set news_status = '0', news_last_modified = now() where article_id = '" . (int)$article_id . "'"
最后一段'" . (int)$article_id . "'" 怪怪的,好像没有规律,我想实现多个参数的拼接这么实现,看得头都大了,哪位大哥指点指点.
update " .TABLE_NEWS_ARTICLES. " set news_status = '0', news_last_modified = now() where article_id = $article_id"
这样会简单些,不过前提是你的article_id字段得是整型字段