Forum Moderators: coopster
However, when it gets to this line, for ($i=0; $i<td>$line[0]</td>, it chokes on one of the '>'.
Since my php skills are very basic, and in no way include arrays, can someone assist me with this?
If it's easier to do it differently, what I'd like to do is create a table in Excel/Access, export it to the server (to a tab-delimted text file, since I'll be using commas in my table cells), and have it display in an HTML table.
If I can't figure this out, I'm tempted to just export to HTML from one or the other program (not sure quite yet which I would use), so ...
Any help would be greatly appreciated - either filling in the missing code for the tutorial linked to above, or directing me to another tutorial that discusses this (lots from HTML to txt/csv), or otherwise.
Thanks :)
~James
[edited by: jatar_k at 2:12 am (utc) on May 26, 2005]
[edit reason] sorry no urls thanks [/edit]
fgetcsv [php.net] is the function you want, you can set the delimiter to a tab if you like, I believe that is "\t" not sure though, must ahve double quotes aroun it though. '\t' just reads as slash t to php as it is unparsed between single quotes.
You could use fgetcsv to read the data from the file, which pulls it into an array fpr you, in the order in which they exist in the file. Then put the values into an insert query and you're off to the races.
1. export and copy your source file to the server
2. use fopen to open a file pointer to your file
3. use fgetcsv to read the next line into an array
4. use that array to construct your INSERT query
5. execute your INSERT query
6. repeat lines 3,4,5 in a loop until you reach the end of file
7. finished