mysql results

Deniz

Active Member
#1
Hallo,

ich habe ein kleines Problem , :mauer: ich schaffe es einfach nicht ALLE User aufzulisten.
Einzelne User zu listen ist kein Problem mit LIKE '$arg' , nur wie liste ich ALLE User.

Code:
 set results [mysqlsel $mysqlS(conn) "SELECT `$tablestats(binfo)` , COUNT(`$tablestats(binfo)`) AS TOTALS FROM `$mysqlS(stats_table)` WHERE `$tablestats(addtime)` >$time AND `$tablestats(addnick)` LIKE '$arg' GROUP BY `$tablestats(binfo)` ORDER BY `$tablestats(addnick)` ASC;" -flatlist]
 set botname [mysqlsel $mysqlS(conn) "SELECT DISTINCT`$tablestats(addnick)` FROM `$mysqlS(stats_table)` WHERE `$tablestats(addtime)` >$time AND `$tablestats(addnick)` LIKE '$arg' LIMIT 20;" -flatlist]
 set total [mysqlsel $mysqlS(conn) "SELECT COUNT(`$tablestats(binfo)`) AS TOTALS FROM `$mysqlS(stats_table)` WHERE `$tablestats(addtime)` >$time AND `$tablestats(addnick)` LIKE '$arg' LIMIT 20;" -flatlist]
kann mir jemand bitte ein beispiel zeigen?
 

Deniz

Active Member
#5
na klar sorry :)

set results [mysqlsel $mysqlS(conn) "SELECT `$tablestats(binfo)` , COUNT(`$tablestats(binfo)`) AS TOTALS FROM `$mysqlS(stats_table)` WHERE `$tablestats(addtime)` >$time GROUP BY `$tablestats(binfo)` ORDER BY `$tablestats(addnick)` ASC;" -flatlist]
set botname [mysqlsel $mysqlS(conn) "SELECT DISTINCT`$tablestats(addnick)` FROM `$mysqlS(stats_table)` WHERE `$tablestats(addtime)` >$time LIMIT 10;" -flatlist]
set total [mysqlsel $mysqlS(conn) "SELECT COUNT(`$tablestats(binfo)`) AS TOTALS FROM `$mysqlS(stats_table)` WHERE `$tablestats(addtime)` >$time LIMIT 10;" -flatlist]
so sieht die ausgabe aus. unsortiert!
blub bang bom added TOTAL 152 !check 92 !news 48 !pong 4 !trash 8
so möchte ich sie haben sortiert , wer was eingetragen hat.
blub total 40 - !check 25 !news 10 !pong 1 !trash 4
bang total 60 - !check 20 !news 35 !pong 2 !trash 3
bom total 52 - !check 40 !news 10
 

Deniz

Active Member
#7
irgendwas mach ich falsch, mysqlmap: too many variables in binding list , könntest du mir das zeigen bitte?

set results [mysqlsel $mysqlS(conn) "SELECT `$tablestats(binfo)` , COUNT(`$tablestats(binfo)`) AS TOTALS FROM `$mysqlS(stats_table)` WHERE `$tablestats(addtime)` >$time GROUP BY `$tablestats(binfo)` ORDER BY `$tablestats(addnick)` ASC;" -flatlist]
set botname [mysqlsel $mysqlS(conn) "SELECT DISTINCT`$tablestats(addnick)` FROM `$mysqlS(stats_table)` WHERE `$tablestats(addtime)` >$time LIMIT 10;" -flatlist]
set total [mysqlsel $mysqlS(conn) "SELECT COUNT(`$tablestats(binfo)`) AS TOTALS FROM `$mysqlS(stats_table)` WHERE `$tablestats(addtime)` >$time LIMIT 10;" -flatlist]
mysqlmap $mysqlS(conn) {botname results total} {
}
putlog "$botname $results"
 
Oben