Jump to content
  • 0

sql query


simplynice

Question


  • Group:  Members
  • Topic Count:  25
  • Topics Per Day:  0.01
  • Content Count:  128
  • Reputation:   4
  • Joined:  11/14/11
  • Last Seen:  

how about we add this every time we do the for loop:

 

set .@int, .@int++; // just like php and other programming language

 

 

How about:

 

set .@int, mysql_num_rows; // count the number of rows

Link to comment
Share on other sites

2 answers to this question

Recommended Posts


  • Group:  Members
  • Topic Count:  75
  • Topics Per Day:  0.02
  • Content Count:  2223
  • Reputation:   593
  • Joined:  10/26/11
  • Last Seen:  

set .@int, .@int++; // just like php and other programming language

 

rAthena already supports increment and decrement operators since r15982.

set .@int, mysql_num_rows; // count the number of rows

 

query_sql already returns the number of rows returned by a SELECT query. Example:

set .@num_rows, query_sql("SELECT `name` FROM `char` 
                           WHERE `name` LIKE '%test%'", .@name$);
mes .@num_rows + " names contain the word *test*";
  • Upvote 1
Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  25
  • Topics Per Day:  0.01
  • Content Count:  128
  • Reputation:   4
  • Joined:  11/14/11
  • Last Seen:  

Thank you for this!

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...