Home >Backend Development >PHP Tutorial >求教一个mysql_query函数的有关问题

求教一个mysql_query函数的有关问题

WBOY
WBOYOriginal
2016-06-13 10:18:43953browse

求教一个mysql_query函数的问题
因为要做排行,所以用到
set @mycnt = 0;
select (@mycnt := @mycnt + 1) as rank,nick_name,total_scores,start_time,expire_time from of_user_exam left join of_user_basic on of_user_exam.user_id = of_user_basic.user_id order by -total_scores,expire_time;
这样两句话,但是两句话放到一个字符串里面用mysql_query执行不了,请问有没有别的方法可以得到结果?

------解决方案--------------------
mycnt的意义是什么,如果是1,2,3,4,5,6,7,8这样的序号,何必在sql语句中?

Statement:
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