Re: [PHP] Creating INSERT INTO statement from dbf file

2005-04-11 Thread Tom Rogers
Hi, Tuesday, April 5, 2005, 6:33:31 AM, you wrote: RSJ> Ave, RSJ> I¹ve written a code that is able to extract the Column names and Records RSJ> from a simple dbf (foxpro) file and create an INSERT INTO sql statement RSJ> which can be used to insert all those records with their corresponding fie

Re: [PHP] Creating INSERT INTO statement from dbf file - SOLVED!

2005-04-11 Thread Rahul S. Johari
Ave, I¹m sure there would be better ways of doing this, and mine may not be the most decent, but I did manage to solve this. Here¹s how I did it: - Create An Array - Run the loop for all the records in the table - Fill the array with the Field Names - Display the Fields names with the ³Comma² bei

Re: [PHP] Creating INSERT INTO statement from dbf file

2005-04-05 Thread Richard Lynch
On Mon, April 4, 2005 1:33 pm, Rahul S. Johari said: > It works fine, except for one problem. It¹s able to create the INSERT INTO > sql statement, with all the fields and corresponding values, but as I¹m > running a loop for both the fields names, and the values corresponding to > fields names, it

Re: [PHP] Creating INSERT INTO statement from dbf file

2005-04-05 Thread Satyam
You can either put a flag indicating your first time around the field loop and add the comma before each field, when it is not the first time around, or build the fieldname and fieldvalue list on a string and then trim out the last character once the loop is finished. "Rahul S. Johari" <[EMAIL

[PHP] Creating INSERT INTO statement from dbf file

2005-04-04 Thread Rahul S. Johari
Ave, I¹ve written a code that is able to extract the Column names and Records from a simple dbf (foxpro) file and create an INSERT INTO sql statement which can be used to insert all those records with their corresponding field names in an existing mySQL table. (A CREATE TABLE code I wrote is able