If you want to import an exel sheet with php to your database, you must have sheet by sheet save as csv and then you can use this ex code
[PHP]<?php
//reading csv file
$fname="file.csv";
$fp=fopen($fname,"r") or die("csv Error");
$line = fgets( $fp, 2024 );
//conexion with db started
$c=mysql_connect("localhost","root","");
if(!$c)
{
die("Not Conected");
}
if(!mysql_select_db("dbspl"))
{
die("Table Error");
}
while(!feof($fp))
{
list($var1,$var2,$var3) =split( ",", $line); //list of variables to import
$line = fgets( $fp, 2024 );
$ctd=$ctd+1;
if($ctd > 1)
{
$var1=strtoupper($var1);//Uppercase
if($loca!="" && $pudoc!="")
{
if(!($inserc=mysql_query("INSERT INTO table (field1,field2,field3)
VALUES('$var1','$var2','$var3')")))
{
echo'<center>';
echo'<br>';
echo mysql_error();
echo'<br>';
echo"User Inser Error";
echo'</center>';
}
}//
}// if($ctd > 1)
} // while(!feof($fp))
fclose($fp);
?> [/PHP]