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

WBOY
Release: 2016-06-13 13:31:50
Original
773 people have browsed it

急,问一个小问题,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'); <div class="clear">
                 
              
              
        
            </div>
Copy after login
Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!