Welcome to the GoFuckYourself.com - Adult Webmaster Forum forums.

You are currently viewing our boards as a guest which gives you limited access to view most discussions and access our other features. By joining our free community you will have access to post topics, communicate privately with other members (PM), respond to polls, upload content and access many other special features. Registration is fast, simple and absolutely free so please, join our community today!

If you have any problems with the registration process or your account login, please contact us.

Post New Thread Reply

Register GFY Rules Calendar
Go Back   GoFuckYourself.com - Adult Webmaster Forum > >
Discuss what's fucking going on, and which programs are best and worst. One-time "program" announcements from "established" webmasters are allowed.

 
Thread Tools
Old 04-02-2007, 11:00 PM   #1
m0307
Confirmed User
 
Join Date: Mar 2006
Location: U.S.
Posts: 221
Is there are script that can do this?

I have currently been developing a website that requires an enormous amount of data to by inputed into a data base. I am currently manually exporting data from a notepad document into my database. This is taking up way too much time having to type everything.

Is there a script out there that can export data from a notepad document into the websites database. My website is written in php. If there isn't a script that does this, is there anyone who could make one?
m0307 is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 04-02-2007, 11:29 PM   #2
m0307
Confirmed User
 
Join Date: Mar 2006
Location: U.S.
Posts: 221
Quote:
Originally Posted by m0307 View Post
I have currently been developing a website that requires an enormous amount of data to by inputed into a data base. I am currently manually exporting data from a notepad document into my database. This is taking up way too much time having to type everything.

Is there a script out there that can export data from a notepad document into the websites database. My website is written in php. If there isn't a script that does this, is there anyone who could make one?

bump....is phpmyadmin the best way to go?
m0307 is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 04-02-2007, 11:31 PM   #3
spacedog
Yes that IS me. Bitch.
 
Industry Role:
Join Date: Nov 2001
Posts: 14,149
There's a way, yes.. I'm not sure on the specifics, but if you ftp the notepad .txt to your server, you can via phpmyadmin import it into tables
spacedog is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 04-03-2007, 12:14 AM   #4
GrouchyAdmin
Now choke yourself!
 
GrouchyAdmin's Avatar
 
Industry Role:
Join Date: Apr 2006
Posts: 12,085
Depends on the format. If it's native SQL, or hand-edited CSV, sure, that's easy.

If you just want to dump a whole blob into a table, it's easiest to do with a throwaway PHP script:
Code:
<?php
mysql_connect($host, $user, $pass) or die("Can't connect to database.");
mysql_select_db($dbname) or die("Can't select database.");
$data=(is_file($filename) && is_readable($filename)) ? file_get_contents($filename) : die("Missing file.");
// ... parse file ...  Let's assume you used a pipe as a delimiter, and data is good
$data = explode("|", $data);
while (list($key, $value, $...) = each($data)) {
    echo "Key: $key; Value: $value<br />\n";
}
?>
...obviously, parsing it and doing the mysql_insert in the loop is up to you. ;)
__________________
GrouchyAdmin is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 04-03-2007, 12:18 AM   #5
GrouchyAdmin
Now choke yourself!
 
GrouchyAdmin's Avatar
 
Industry Role:
Join Date: Apr 2006
Posts: 12,085
To append to the above (edit timer ran out): I could likely make what you need if you could tell me what you want, or offered a dbschema (what you're dumping, where). Depending on complexibility, most of the work is already done above.
__________________
GrouchyAdmin is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 04-03-2007, 12:24 AM   #6
darksoul
Confirmed User
 
darksoul's Avatar
 
Join Date: Apr 2002
Location: /root/
Posts: 4,997
Quote:
Originally Posted by GrouchyAdmin View Post
Depends on the format. If it's native SQL, or hand-edited CSV, sure, that's easy.

If you just want to dump a whole blob into a table, it's easiest to do with a throwaway PHP script:
...obviously, parsing it and doing the mysql_insert in the loop is up to you. ;)
You don't need a script to import a csv file.
__________________
1337 5y54|)m1n: 157717888
BM-2cUBw4B2fgiYAfjkE7JvWaJMiUXD96n9tN
Cambooth
darksoul is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 04-03-2007, 01:22 AM   #7
GrouchyAdmin
Now choke yourself!
 
GrouchyAdmin's Avatar
 
Industry Role:
Join Date: Apr 2006
Posts: 12,085
Quote:
Originally Posted by darksoul View Post
You don't need a script to import a csv file.
You have console access.. and most users don't have the ability to turn on load file support, assuming, of course, this is applicable. However, yes, if you're doing CSV, phpMyAdmin would be the easy choice. ;)
__________________
GrouchyAdmin is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Post New Thread Reply
Go Back   GoFuckYourself.com - Adult Webmaster Forum > >

Bookmarks



Advertising inquiries - marketing at gfy dot com

Contact Admin - Advertise - GFY Rules - Top

©2000-, AI Media Network Inc



Powered by vBulletin
Copyright © 2000- Jelsoft Enterprises Limited.