Latest News: OOTP PATCH 9.2.2 released - buy before Oct. 17th and save $10! - OOTP 9 RELEASED! - Title Bout Championship Boxing 2.5 released! - OOTP 2007 receives Editors Choice Award from PC Gamer - Inside the Park Baseball Patch 1.03 released, DEMO now available

Click here to download Out of the Park Baseball 9!

Go Back   OOTP Developments Forums > OUT OF THE PARK BASEBALL 9 > OOTP 9 - Mods > Database Tools
Register FAQ Members List Calendar Search Today's Posts Mark Forums Read

Database Tools Do you need to take a dump? SQL gurus welcome

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old 06-02-2006, 01:57 PM   #1 (permalink)
All Star Starter
 
DaveHorn's Avatar
 
Join Date: Aug 2003
Posts: 1,110
OPI (OOTP 2006 PHP Importer)

The first version is available for public release. I submitted a dumbed down version of this for the contest, but I've put the finishing touches on this for now and am making it available to the masses.

OPI requires PHP 4.1 or greater with PEAR DB. PEAR is a DB independent API which allows OPI to be used with DBs beyond just MySQL. Although, I have currently only tested it with MySQL.

The readme file in the download contains installation and use directions.

Download Here

Feel free to post comments, suggestions, questions here.
__________________
Dave
HFTC Commish
DaveHorn is offline   Reply With Quote
Old 06-02-2006, 02:21 PM   #2 (permalink)
Minors (Double A)
 
Join Date: Sep 2003
Posts: 161
Have not actually ran the code but looking through it and it is much more sphoisticated then the 20 liner I threw together just to do it.

I really like the abstraction of the DB layer with PEAR, but I wonder if some will not have that enabled or available.

Also you may should be able to use PEAR or the DB_ado specifically to possibally have a import to MSAccess.



__________________
Scott Stewart

World Baseball Hierarchy - Calgary Outlaws
Beyond the Ivy - Chicago Cubs
Stars and Strips Baseball League - Chicago White Soxs
Action Pack Baseball League - Toronto Blue Jays
Diskostew22 is offline   Reply With Quote
Old 06-02-2006, 02:33 PM   #3 (permalink)
All Star Starter
 
DaveHorn's Avatar
 
Join Date: Aug 2003
Posts: 1,110
I agree, PEAR does support many DBs, I use it with PostGreSQL (far superior to MySQL ) everyday. Although, I only tested this with MySQL because I know that is what 99.99% of the OOTP community will have and my time is limited. I'd be very interested to hear of success stories with other DBs. Problems will likely arise with some non-standard SQL DBs because CREATE TABLE constructs in non-SQL standard DBs are usually somewhat proprietary.

In my experience, any shared hosting company I've dealt with had PEAR installed by default. But I'm sure there are exceptions out there.

It has been GPL'd, so anyone could of course convert the code to use the dependent mySQL php statements instead of PEAR. But the fact that I used PEAR will even make that easier, because they could simply make their own DB.php class, implement a handful of methods, put it at the same directory level, and my code would pickup their DB.php and not PEARS and make the DB dependent API calls instead of using the real PEAR DB.php.
__________________
Dave
HFTC Commish
DaveHorn is offline   Reply With Quote
Old 06-03-2006, 05:14 PM   #4 (permalink)
Major Leagues
 
dangarion's Avatar
 
Join Date: Feb 2003
Location: Stanton, CA
Posts: 433
I get the following error when attempting to run this with my host.

Fatal error: Cannot redeclare scandir() in /home/xxx/xxx/xxx/ootp/ootp2006import.php on line 263

I'm using PHP5, which might be the problem considering I see some issues with this error dealing with php5. I will see what happens in PHP4 in a moment.
__________________
DanGarion
GM - Los Angeles Dodgers RWBL
As Real As It Gets!

Last edited by dangarion : 06-03-2006 at 05:17 PM.
dangarion is offline   Reply With Quote
Old 06-04-2006, 09:42 AM   #5 (permalink)
Major Leagues
 
dangarion's Avatar
 
Join Date: Feb 2003
Location: Stanton, CA
Posts: 433
I went to PHP 4 and it works fine. Now I just have to open up my PHP book and refresh myself on what I can do with this.
__________________
DanGarion
GM - Los Angeles Dodgers RWBL
As Real As It Gets!
dangarion is offline   Reply With Quote
Old 06-04-2006, 10:21 AM   #6 (permalink)
All Star Starter
 
DaveHorn's Avatar
 
Join Date: Aug 2003
Posts: 1,110
I have a function called scandir which is a exact replication of the same function in PHP5. PHP5 folks could comment out my redeclared function and it should work fine, but I'll just rename the function for future PHP5 users.
__________________
Dave
HFTC Commish
DaveHorn is offline   Reply With Quote
Old 06-04-2006, 11:17 AM   #7 (permalink)
Hall Of Famer
 
Cooleyvol's Avatar
 
Join Date: Dec 2001
Location: Woodland Mills, TN
Posts: 4,129
Dave, tell me exactly what this does. I'm a newb, I guess.
__________________





Subscribe to Gridiron Glory Radio

SEC Champions, 2006,2008-14
2008, 2011 National Runners-up
2009, 2010, 2012, 2013 National Champions
Cooleyvol is offline   Reply With Quote
Old 06-04-2006, 11:46 AM   #8 (permalink)
All Star Starter
 
DaveHorn's Avatar
 
Join Date: Aug 2003
Posts: 1,110
It uses the SQL dump output from OOTP2006 and automatically loads your entire OOTP universe into your database. This is essential for anyone building addons for OOTP2006 (i.e. future CATOs or BOSIs). Its also extremely useful (if you know SQL) if you want to create customized reports or get to your data in specific ways. For example, I recently wrote a script to compare my OOTP6 data (using commish joe's exporters/BOSI2) to my OOTP2006 data of the same imported league. I was able to quickly spit out a report of every single player not imported and those who lost positions and get a look into my conversion not possible simply with a eyes on approach.
__________________
Dave
HFTC Commish
DaveHorn is offline   Reply With Quote
Old 06-25-2006, 11:15 PM   #9 (permalink)
Hall Of Famer
 
fantom1979's Avatar
 
Join Date: Jul 2002
Location: Detroit, MI
Posts: 3,069
Quote:
Originally Posted by Diskostew22
Have not actually ran the code but looking through it and it is much more sphoisticated then the 20 liner I threw together just to do it.

I really like the abstraction of the DB layer with PEAR, but I wonder if some will not have that enabled or available.

Also you may should be able to use PEAR or the DB_ado specifically to possibally have a import to MSAccess.
Would you mind posting that 20 liner?

Thanks
__________________
A crude version of what I would like to see in-game:
http://fantom1979.homeip.net/ootp/streaks.php

"I'm not out here to win a beauty contest."


fantom1979 is offline   Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is On
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT -4. The time now is 03:52 AM.


Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.1.0
Copyright © 2008 Out of the Park Developments