PHP 单引号字符串里引用变量时要注意
例子:
$nSql = ’SELECT news_id, title, add_time FROM news WHERE passed = 1 ORDER BY add_time DESC LIMIT $offset,$psize‘;
$nQue = mysql_query($nSql);
$nSql 语句中的$offset,$psize变量将不被解析,所以当字符串中引用变量用.点连接,或者直接用双引号,上面语句改成$nSql = “SELECT news_id, title, add_time FROM news WHERE passed = 1 ORDER BY add_time DESC LIMIT $offset,$psize”;就完全可以执行了。