|
|
|
||||
|
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. |
![]() |
|
|||||||
| Discuss what's fucking going on, and which programs are best and worst. One-time "program" announcements from "established" webmasters are allowed. |
|
|
Thread Tools |
|
|
#1 |
|
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? |
|
|
|
|
|
#2 | |
|
Confirmed User
Join Date: Mar 2006
Location: U.S.
Posts: 221
|
Quote:
bump....is phpmyadmin the best way to go? |
|
|
|
|
|
|
#3 |
|
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
|
|
|
|
|
|
#4 |
|
Now choke yourself!
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";
}
?>
__________________
|
|
|
|
|
|
#5 |
|
Now choke yourself!
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.
__________________
|
|
|
|
|
|
#6 | |
|
Confirmed User
Join Date: Apr 2002
Location: /root/
Posts: 4,997
|
Quote:
|
|
|
|
|
|
|
#7 |
|
Now choke yourself!
Industry Role:
Join Date: Apr 2006
Posts: 12,085
|
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. ;)
__________________
|
|
|
|