当前位置: 代码迷 >> PHP >> 急问一个小疑点,php中mysql语句
  详细解决方案

急问一个小疑点,php中mysql语句

热度:101   发布时间:2016-04-29 01:17:26.0
急,问一个小问题,php中mysql语句
set @count = 0;
select index from (select (@count := @count+1) as index ,id from table ) as abc ;
这句话怎么改成php可以执行的,那个变量怎么声明赋值,求大大解惑!

------解决方案--------------------
PHP code
//分两次执行。mysql_query('set @count = 0');$result = mysql_query('select index from (select (@count := @count+1) as index ,id from table ) as abc');
  相关解决方案