|
|
| P is for Practical | |
| PerlMonks |
Display row number perl DBIby romy_mathew (Beadle) |
| on May 28, 2012 at 16:22 UTC ( #972840=perlquestion: print w/ replies, xml ) | Need Help?? |
|
romy_mathew has asked for the
wisdom of the Perl Monks concerning the following question:
Hi,
Can anybody suggest how to display a row number in mysql query. I am able to get this done in mysql query by
select @rownum:=@rownum+1 AS rank, p.* from player p, (SELECT @rownum:=0) r order by score desc limit 10 But when I use this in $sth = $dbh->prepare("Select @rownum:=@rownum+1 ‘rank’, p.* from player p, (SELECT @rownum:=0) r order by score desc limit 10"); I get errors and the statement is not getting executed. ANy Suggestion ...?
Back to
Seekers of Perl Wisdom
|
|
||||||||||||||||||||||||||||