Home | Webstore
Latest News: OOTP 13 THIRD Update Available: Version 13.3.9! - OOTP 13 Released! Download Now! - iOOTP 2012 Available NOW on the AppStore - Title Bout Championship Boxing 2.5 released!

Download OOTP 13 Now! | Download iOOTP 2012 from the AppStore

Go Back   OOTP Developments Forums > Out of the Park Baseball 13 > OOTP Mods > OOTP Mods - Database Tools

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

Reply
 
LinkBack Thread Tools Display Modes
Old 06-02-2006, 01:57 PM   #1 (permalink)
All Star Starter
 
DaveHorn's Avatar
 
Join Date: Aug 2003
Posts: 1,141
Thanks: 1
Thanked 1x in 1 post
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
Thanks: 0
Thanked 0x in 0 posts
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,141
Thanks: 1
Thanked 1x in 1 post
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)
All Star Reserve
 
dangarion's Avatar
 
Join Date: Feb 2003
Location: Orange, CA
Posts: 509
Thanks: 8
Thanked 3x in 3 posts
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 Angels of Anaheim The Peanuts and Cracker Jack Baseball League
PCJBL!

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)
All Star Reserve
 
dangarion's Avatar
 
Join Date: Feb 2003
Location: Orange, CA
Posts: 509
Thanks: 8
Thanked 3x in 3 posts
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 Angels of Anaheim The Peanuts and Cracker Jack Baseball League
PCJBL!
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,141
Thanks: 1
Thanked 1x in 1 post
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: 5,993
Thanks: 57
Thanked 506x in 304 posts
Dave, tell me exactly what this does. I'm a newb, I guess.
__________________


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,141
Thanks: 1
Thanked 1x in 1 post
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,496
Thanks: 42
Thanked 48x in 25 posts
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
fantom1979 is offline   Reply With Quote
Reply

Bookmarks

Thread Tools
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

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



All times are GMT -4. The time now is 02:18 PM.


Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2012, vBulletin Solutions, Inc.
Search Engine Friendly URLs by vBSEO 3.6.0
Copyright © 2009 Out of the Park Developments