we are all easily find the number of records will come using myslq query.now i am going to explain about how to automatically add the line number in mysql query.
in mysql we have the option to set the user defined variables, using that we are going to add automatic line number in mysql result.
more information about mysql user variable from here
http://dev.mysql.com/doc/refman/5.0/en/user-variables.html
using that user defined variable we can add get automatically line number.
example:
select @linenum:=@linenum+1 row,a.title from (select @linenum:=0) l ,jos_content a
(select @linenum:=0) l using this we can set user defined variable as 0.using the above query image will come like this
Nice work!. thanks to share this. it reduce my time on google search
ReplyDelete