k, here's two ways. neither is that "elegant", but they should work
(1)...you could save the excel file as a tab delimited file (or comma separated, whichever offers the least chance for a repeat value, such as a comma in one of the values..i would probably suggest using a tab-delimited). then you could shove this all into an array in php, and insert one by one based on that...like this:
<?
$file = "./test_split.txt";
$f = fopen ($file, "r"); //open the file for reading
$data = fread ($f, filesize ($file)); //push the values into $data
fclose ($f); //close the file
$data = split("\t",$data); //make an array
//connect to db
$db = mysql_connect("host","username","pwd");
mysql_select_db("yourdb");
$query = "SELECT * FROM user WHERE user_id='$user_id'";
for($i=0;$i<=count($data);$i++){
mysql_query("INSERT INTO yourtable (field) VALUES ('" . $data[$i] . "')");
}
mysql_close($db); //close the db connection
?>
although it's possible that it will choke on some records if it's a huge file. (2) another way would be to bring in the text file like you did in (1), and then write back out a text file that you would use with phpmyadmin (for ease of explanation)...you could insert the text file into the db, and it may be a little more solid.
<?
$file = "./test_split.txt";
$f = fopen ($file, "r"); //open the file for reading
$data = fread ($f, filesize ($file)); //push the values into $data
fclose ($f); //close the file
$data = split("\t",$data); //make an array
$filetowrite = "./newfile.txt";
$fw = fopen ($filetowrite, "w"); //open a new file for writing
for($i=0;$i<=count($data);$i++){
fwrite($fw,"INSERT INTO yourtable VALUES ('" . $data[$i] . "');");
fwrite($fw, "\n");
}
fclose($fw);
?>
..of course, this only handles one column, but it wouldn't be very complicated to expand it.
hope this helps a little bit!
chris( )