Dear Wizard of Menlo Park Jr.;

Similar to what you want but not exactly the same.  Use the bits that you
can use.
I recently took an excel spreadsheet converted it to a tab delimited text
file and then stored the records into a mysql table using the following

Hope this helps,

if (! $link) die("Can't log in at this time");
mysql_select_db($db,$link) or die ("Can't log in at this time");

print "<table align=center cellpadding=7 cellspacing=0 border=1

$fp=fopen("excel_file.txt","r") or die ("Couldn't open file");

while (!feof ($fp))
    list($last,$first,$title,$rating,$year,$city)= split ("\t", $record, 6);
    print "<tr>
    $query="insert into chess_players (first_name, last_name, title, rating,
year, city)
    values ('".addslashes($first)."',
                '".addslashes($city)."' )";
    if (!$result) die ("couldn't update chess_players".mysql_error());
print "</table>";
----- Original Message -----
From: "Thomas Edison Jr." <[EMAIL PROTECTED]>
Sent: Tuesday, April 16, 2002 11:16 PM
Subject: [PHP] importing .dat SQL Data into mySQL

> Hi,
> I have a .dat file.. with some data like this :
> 020000001IN00100213200207120020412200204122002041710002002041720020417
> 020000002IN00100213200207220020415200204152002041810002002041820020418
> 020000003IN00100213200207320020416200204162002041910002002041920020419
> This data was exported via SQL Server.. using Oracle.
> I need to use this data in my mySQL Database and work
> on it through PHP.
> Can i use phpMyAdmin for this.. or some other method?
> Thanks,
> T. Edison Jr.
> __________________________________________________
> Do You Yahoo!?
> Yahoo! Tax Center - online filing with TurboTax
> --
> PHP General Mailing List (
> To unsubscribe, visit:

PHP General Mailing List (
To unsubscribe, visit:

Reply via email to