RE: [PHP-DB] Parsing CSV files into a MySQL Table

2004-11-02 Thread Alex Bovey
> mysql_query ("INSERT INTO 'footable' (foo1, foo2, foo3, > foo4, foo5, foo6, foo7) > VALUES '$foo1', '$foo2', '$foo3', '$foo4', > '$foo5', '$foo6', '$foo7')"); } You're also missing an opening bracket after 'VALUES'. The statement should be: mysql_query ("INSERT INTO 'foo

Re: [PHP-DB] Parsing CSV files into a MySQL Table

2004-11-02 Thread Jason Wong
On Tuesday 02 November 2004 13:46, Mark Benson wrote: > mysql_connect (localhost, foouser, foologin); Always use check the return value of any mysql_*() function you use and make use of mysql_error(). > $csvfile = file("http://foo.com/foolist.csv";); If you're using a newer version of PHP you

Re: [PHP-DB] Parsing CSV files into a MySQL Table

2004-11-02 Thread Matt M.
> > $csvfile = file("http://foo.com/foolist.csv";); and this fopen("http://foo.com/foolist.csv";, "r"); -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP-DB] Parsing CSV files into a MySQL Table

2004-11-02 Thread Matt M.
> // > mysql_connect (localhost, foouser, foologin); > > mysql_select_db (footest1); > > $csvfile = file("http://foo.com/foolist.csv";); > > foreach($csvfile as $line_no => $datastring) { > $data = explode (",", $datastring); > $foo1 = $data[0]; > $foo2 = $data[1]; >

[PHP-DB] Parsing CSV files into a MySQL Table

2004-11-02 Thread Mark Benson
Hi, newbie here, go easy on me I'm learning this as I go ;) Got a bit of teaser here. //http://foo.com/foolist.csv";); foreach($csvfile as $line_no => $datastring) { $data = explode (",", $datastring); $foo1 = $data[0]; $foo2 = $data[1]; $foo3 = $data[2];