Home | Webstore
Latest News: OOTP Update 20.5.52 - OOTP 20 Available - FHM 5 Available

MLB All-Star Game Special: Save 50% on OOTP 20!

  

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

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

Reply
 
Thread Tools
Old 06-02-2006, 01:57 PM   #1
DaveHorn
All Star Starter
 
DaveHorn's Avatar
 
Join Date: Aug 2003
Posts: 1,146
Thanks: 2
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
Diskostew22
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
DaveHorn
All Star Starter
 
DaveHorn's Avatar
 
Join Date: Aug 2003
Posts: 1,146
Thanks: 2
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
dangarion
All Star Reserve
 
dangarion's Avatar
 
Join Date: Feb 2003
Location: Orange, CA
Posts: 569
Thanks: 16
Thanked 5x in 5 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 Dodgers 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
dangarion
All Star Reserve
 
dangarion's Avatar
 
Join Date: Feb 2003
Location: Orange, CA
Posts: 569
Thanks: 16
Thanked 5x in 5 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 Dodgers The Peanuts and Cracker Jack Baseball League
PCJBL!
dangarion is offline   Reply With Quote
Old 06-04-2006, 10:21 AM   #6
DaveHorn
All Star Starter
 
DaveHorn's Avatar
 
Join Date: Aug 2003
Posts: 1,146
Thanks: 2
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
Cooleyvol
Hall Of Famer
 
Cooleyvol's Avatar
 
Join Date: Dec 2001
Location: Union City, TN
Posts: 6,309
Thanks: 67
Thanked 636x in 375 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
DaveHorn
All Star Starter
 
DaveHorn's Avatar
 
Join Date: Aug 2003
Posts: 1,146
Thanks: 2
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
fantom1979
Hall Of Famer
 
fantom1979's Avatar
 
Join Date: Jul 2002
Location: Detroit, MI
Posts: 3,497
Thanks: 45
Thanked 50x in 27 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

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

Forum Jump


All times are GMT -4. The time now is 09:55 PM.

 

Major League Baseball trademarks and copyrights are used with permission of MLB Advanced Media, L.P. Minor League Baseball trademarks and copyrights are used with the permission of Minor League Baseball. All rights reserved.

The Major League Baseball Players Association (www.MLBPLAYERS.com ) is the collective bargaining representative for all professional baseball players of the thirty Major League Baseball teams and serves as the exclusive group licensing agent for commercial and licensing activities involving active Major League baseball players. On behalf of its members, it operates the Players Choice licensing program and the Players Choice Awards, which benefit the needy through the Major League Baseball Players Trust, a charitable foundation established and run entirely by Major League baseball players. Follow: @MLB_Players; @MLBPAClubhouse; @MLBPlayersTrust

Out of the Park Baseball is a registered trademark of Out of the Park Developments GmbH & Co. KG

Google Play is a trademark of Google Inc.

Apple, iPhone, iPod touch and iPad are trademarks of Apple Inc., registered in the U.S. and other countries.

COPYRIGHT © 2017 OUT OF THE PARK DEVELOPMENTS. ALL RIGHTS RESERVED.

 

Powered by vBulletin® Version 3.8.10
Copyright ©2000 - 2019, vBulletin Solutions, Inc.
Copyright © 2018 Out of the Park Developments