Hi Steven,
I find the easiest way is to use phpMyAdmin - insert text from file.
You can manipulate one of the files in Excel (play around with the columns and record what you do in a macro) to make them match up.
Hi guys
I'm looking for a feed insertion php script that will allow me to grab selected feeds from AW or Buy.at and insert them into my database automatically.
If anyone has a script they would be willing to share it would be much appreciated.
Warmest wishes.
Steven
--
Virtual Cards UK
http://www.virtualcards.co.uk
Hi Steven,
I find the easiest way is to use phpMyAdmin - insert text from file.
You can manipulate one of the files in Excel (play around with the columns and record what you do in a macro) to make them match up.
I used to have an open mind but my brains kept falling out.
obviously just the basics.... (all php)
## connect to your database stuff...
$row = 1;
$handle = fopen("$datafeed","r");
while ($data = fgetcsv ($handle, 100000, ",")) {
$row++;
// opens the file specified by $datafeed and calls all the columns $data[...]
$sql = "INSERT INTO tablename (all,your,stuff)
VALUES ('$data[0]', '$data[1]', '$data[2]')";
// where $data[0] is the first column, $data[1] is the second etc from the CSV file.
$result = mysql_query($sql);
}
fclose ($handle);
## close database connection
once you know which feed your using, you can do like str_replace on certain things to make it all tidy.
For datafeeds that are zipped you can use gzopen instead of fopen
lakrasia, this way saves you downloading the feeds, which can take a while. and it does all the matching up for you, which is always nice![]()
hope its of use
Dan Morley
alpharooms.com
daniel at alpharooms dot com - Hotels, Flights, Airport Transfers, Care Hire + More! sign up
My Blog | Cheap Holidays
Hi, thanks from me too, then. I tend to stick with anything that works, but I can see a few benefits from using a script instead.
I used to have an open mind but my brains kept falling out.
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks