The forums will be going offline for an extended maintenance period at 1400hrs GMT on 19th June 2025. The number of hours for this downtime is intentionally not advertised due to the nature of these upgrades.
×
- 0
Matching values using SQL with multiple tables
-
Recently Browsing 0 members
- No registered users viewing this page.
Question
Nyaniverse
I'm trying to match the points to their names and aid on another table, but somehow the points are not going to their assigned aid, any clues on how to properly set it?
.@sql$ = " SELECT `account_id`,`value` " + " FROM `acc_reg_num`" + " WHERE `key` = '#s_alltime' " + " AND `value` >= 1" + " ORDER BY `value` DESC LIMIT 20"; query_sql(.@sql$,.@aid,.@total); query_sql("SELECT `aid`,`name` FROM `test_db`",.@said,.@name$); //comparing who's going to be in the ranking for(.@i = 0; .@i < getarraysize(.@aid); .@i++) if(inarray(.@said[0],.@aid[.@i]) != -1){ .@all_time$[.@i] = .@name$[inarray(.@aid[0],.@said[.@i])]; .@all_time[.@i] = .@total[inarray(.@aid[0],.@said[.@i])]; }
Link to comment
Share on other sites
1 answer to this question
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.