Go Back   RunUO - Ultima Online Emulation > Developer's Corner > Programming > Script Languages

Script Languages Perl/PHP/Python/Ruby so on and so forth.

Reply
 
Thread Tools Display Modes
Old 12-02-2005, 10:55 PM   #1 (permalink)
Forum Expert
 
Vorspire's Avatar
 
Join Date: Jan 2005
Location: Newcastle, United Kingdom
Age: 21
Posts: 2,298
Send a message via ICQ to Vorspire Send a message via MSN to Vorspire Send a message via Skype™ to Vorspire
Default First Post This Forum! : PhP - Auto Update MySQL

w00t for the first post of this forum!

Is it possible to make a php script that will automatically take data from a .txt file and enter it into tables in MySQL on LocalHost?

If so, how can i make MyRunUO upload to an FTP instead of ODBC to the Database, as the database i use does not support external connection...

__________________

WWW.RPK-UO.COM - The WoW-UO Cross-Over Shard
Vorspire is online now   Reply With Quote
Old 12-02-2005, 11:01 PM   #2 (permalink)
Account Terminated
 
Join Date: Sep 2002
Age: 26
Posts: 3,846
Send a message via ICQ to Phantom Send a message via AIM to Phantom Send a message via MSN to Phantom
Default

Quote:
Originally Posted by Admin Vorspire
w00t for the first post of this forum!

Is it possible to make a php script that will automatically take data from a .txt file and enter it into tables in MySQL on LocalHost?

If so, how can i make MyRunUO upload to an FTP instead of ODBC to the Database, as the database i use does not support external connection...

Why don't you make it support an external connection. There is no reason you can't, can even only allow connections from a certain ip/dns address.

The answer to your question, is yes its possible, but it wouldn't perform very well.
Phantom is offline   Reply With Quote
Old 12-02-2005, 11:34 PM   #3 (permalink)
Forum Expert
 
Vorspire's Avatar
 
Join Date: Jan 2005
Location: Newcastle, United Kingdom
Age: 21
Posts: 2,298
Send a message via ICQ to Vorspire Send a message via MSN to Vorspire Send a message via Skype™ to Vorspire
Default

The service host i am using say that ODBC could cause security risks... So they won't install it.
__________________

WWW.RPK-UO.COM - The WoW-UO Cross-Over Shard
Vorspire is online now   Reply With Quote
Old 12-02-2005, 11:45 PM   #4 (permalink)
Master of the Internet
 
TMSTKSBK's Avatar
 
Join Date: Feb 2004
Location: NC/NC State Univ
Age: 23
Posts: 16,424
Default

Quote:
Is it possible to make a php script that will automatically take data from a .txt file and enter it into tables in MySQL on LocalHost?
most assuredly, and I have no idea.
__________________
Goodbye, folks.
TMSTKSBK is offline   Reply With Quote
Old 12-04-2005, 09:57 PM   #5 (permalink)
Newbie
 
Join Date: Oct 2004
Location: Charleston, SC
Age: 27
Posts: 37
Send a message via ICQ to LightShade Send a message via AIM to LightShade
Smile Try something like this

I didn't test this, but I think this is what you're looking for....

PHP Code:
mysql_connect("localhost","username","password") or die ("Couldn't Connect to Server...");
mysql_select_db("database") or die ("Couldn't Connect to Database...");
$fp fopen("test.txt""r");
while (!
feof)
{
$text fgets($fp255);
$query ="INSERT INTO table (field)";
$query.=" VALUES ('$text')";
$result=mysql_query($query);

LightShade is offline   Reply With Quote
Old 12-19-2006, 10:16 PM   #6 (permalink)
Forum Newbie
 
Join Date: Dec 2006
Location: Southern Indiana, USA
Posts: 11
Default

You could always make the php script to run on your shard pc as cmdline task through the task scheduler and do it that way. Does your host allow non-local host connections to the mysql databases?

Or, Modify the server to fire that connection and do the same. Send the text file's info through the connection in the server. I've done very similar in the past, using a shard script to update a mysql db on the fly from an in game command (listing of all npc types and such). Was not on RunUO though, but, with the C# it should be very easily done.
__________________
Penguin Scripter
MuadDib is offline   Reply With Quote
Old 12-19-2006, 10:49 PM   #7 (permalink)
Forum Expert
 
Kenny164's Avatar
 
Join Date: Sep 2004
Location: Ballymena, Northern Ireland
Age: 23
Posts: 464
Send a message via MSN to Kenny164
Default

Nice advice, but a bit late... [RunUO 2.0 RC1] Complete Automated Web Accounting Service 1.0
__________________
Use the middle mouse button on Here for forum rules, if nothing happens get firefox and try again!!!
Kenny164 is offline   Reply With Quote
Old 12-19-2006, 10:51 PM   #8 (permalink)
Forum Newbie
 
Join Date: Dec 2006
Location: Southern Indiana, USA
Posts: 11
Default

Better late than never...... always forget to check thread dates, hehehe.
__________________
Penguin Scripter
MuadDib is offline   Reply With Quote
Reply

Bookmarks


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
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 Off
Pingbacks are Off
Refbacks are Off



Powered by vBulletin® Version 3.7.0
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
SEO by vBSEO 3.2.0 RC5