Two Plus Two Newer Archives

Two Plus Two Newer Archives (http://archives1.twoplustwo.com/index.php)
-   Software (http://archives1.twoplustwo.com/forumdisplay.php?f=47)
-   -   Querying a MYSQL database? (http://archives1.twoplustwo.com/showthread.php?t=142516)

hyped1 06-19-2006 10:55 PM

Querying a MYSQL database?
 
I use pokeroffice and recently downloaded mysql and converted poker office to use mysql database instead. I want to be able to query the database myself. I backup my database through poker office and it creates a backup of my database as a myz file. Now, how do I query the database within this file? I want to be able to conduct such queries as SELECT playername WHERE vpip > 40 or something like that. Do I need to create a php script to connect to the database in the local myz file and then upload to a webserver and query the database that way? Thanks for any help.

tomtemor 06-20-2006 03:26 AM

Re: Querying a MYSQL database?
 
I'm not capable of helping you out but I suggest you to ask the same thing in Poker Office's forums as well.

Good luck

luckydonut 06-21-2006 03:31 PM

Re: Querying a MYSQL database?
 
Tweak this to get the desired result. This query finds players with 40% or higher flops seen (just because it's easier to find than VPIP) at 2/4 full ring. They must have played at least 100 hands also. You could also add in a condition for game.site_id to restrict it to a particular site.

Give it a while to run if you've got a big database...

<font class="small">Code:</font><hr /><pre>
select p.nickname,
count(distinct g.gameid) as hands,
sum(a.sawflop)/count(distinct g.gameid) * 100 as sawflop,
sum(a.raisedpreflop)/count(distinct g.gameid) * 100 as pfr
from player p, action a, game g
where p.playerid = a.playerid
and a.gameid = g.gameid
and g.nrofplayers between 7 and 10
and g.level = '2/4'
group by p.playerid
having sawflop &gt;= 40 and hands &gt;= 100
order by sawflop desc, pfr;
</pre><hr />

I did attempt to add post-flop aggression into the query, but it gets messy as you have to look at various combinations of fields and I'm still not sure that it works correctly...


All times are GMT -4. The time now is 09:04 AM.

Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2026, vBulletin Solutions Inc.