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 05-31-2005, 05:47 AM   #1
fireorange
Confirmed User
 
Join Date: Jan 2005
Posts: 1,648
PHP newbie question

I'm searching for the code to batch import stuff into a MySQL db, can't find shit.

Example:

abc
zyx
qwe
asd

Each on a seperate line, from a HTML form submit.

Any help?
fireorange is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 05-31-2005, 06:03 AM   #2
ddfGandalf
Confirmed User
 
Join Date: Feb 2005
Location: Budapest, Hungary
Posts: 534
Dunno really what you need, but you could use $HTTP_POST_VARS or $HTTP_GET_VARS depending on your form action, then process the array (while) and simple INSERT into db?
__________________
ddfGandalf is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 05-31-2005, 06:09 AM   #3
Serge Litehead
Confirmed User
 
Serge Litehead's Avatar
 
Industry Role:
Join Date: Dec 2002
Location: Behind the scenes
Posts: 5,190
batch import: http://sunsite.mff.cuni.cz/MIRRORS/f...atch_mode.html

the example is not clear in regards to mysql subject
__________________
Serge Litehead is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 05-31-2005, 06:20 AM   #4
MickeyG
Confirmed User
 
Join Date: May 2004
Location: South Florida
Posts: 4,134
if its a html submit use a loop, otherwise you can use a txt file and then import into mysql.
MickeyG is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 05-31-2005, 06:27 AM   #5
fireorange
Confirmed User
 
Join Date: Jan 2005
Posts: 1,648
Quote:
Originally Posted by MickeyG
if its a html submit use a loop, otherwise you can use a txt file and then import into mysql.
Yea that's what I want but I can't find any sample code on Google to use.
fireorange is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 05-31-2005, 07:01 AM   #6
psili
Confirmed User
 
Join Date: Apr 2003
Location: Loveland, CO
Posts: 5,526
something like:

Code:
$txt_array = file('/path/to/file.txt');
$db = ....connect to db

for($i=0;$i<count($txt_array);$i++)
{
  $sql = "insert into something where
}

...
FUCK THAT...

Can't you just format your text file like how the table is formatted and run something like:

>load data infile .....

-- search good for "load data in file" -- that'd be the fastest and easiest if possible.
__________________
Your post count means nothing.
psili 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.