what is the format of ur excell ? you can convert it to csv u will have a format like this : fiel1 , field 2 , field 3 .... etc then u can using textpad add the query to convert to : insert... (field1 , ....,field3);
Ok commandos.thnx. But I don't understand again. Example. I have a telephony numeratory database in excel 2003,and i want to build a code to wiew or search this numbers. I have 40 Databases in excel(each for one city),each of those have 4 columns:NAME,SURNAME,TEL. NUMBER,ADDRES. I have posibility to take this database from my oracle Server in,txt,access,excel.But i dont know how to take in MySQL? Can u help me to build this code in php? Thakns at all.
I used this to read in a flat text file to a mySQL database: <?php echo"Slurp begins ...<P>\n"; //Read in the data to an array $nameFile = './data/Nations.txt'; $allNations = @file("$nameFile"); //Loop through each entry/string in the array foreach ($allNations as $nationString) { //In this case, the text files contains lines formatted thus: //AF AFG 004 Afghanistan //So we need to split the string $split=(explode(' ', $nationString, 4)); $a1=$split[0]; $a2=$split[1]; $a3=$split[2]; $a4=$split[3]; //Write the data $sql="INSERT INTO atlas (atlas2letter, atlas3letter, atlasCode, atlasName) VALUES ('{$a1}', '{$a2}', '{$a3}', '{$a4}')"; do_sql($sql); } echo"Done"; ?> Code (markup): If you save the excel files as a csv you can use this by tweaking the explode bit to delimit by commas rather than spaces
If you can get it into an access database you can use this http://www.bullzip.com/products/a2m/info.php to import it into a remote mysql database, assuming the mysql server allows remote management.