hi Php gurus... i am a newbie so pls help me... my client wants he will manage to upload csv or .sql file by file field and the the data will populate in the database. i am using php and my sql .how can i do this ..pls help me
You can try 2 following ways: 1. Easy way: you can using phpmyadmin.net (mysql web client. you can find more at google with keyword "mysql manager" or "mysql web client"). With phpmyadmin, you can manage, backup, restore,... your mysql database. phpmyadmin also support cvs, sql,... 2. Write a restore.php yourself ^__^
If it's a .sql exported file it is already one big mysql query. Can't you just use file_get_contents to put the sql file in a string and then mysql_query() that string? csv is a different story, you'll need to read the file and use explodes to generate the right query. phpmyadmin is the easiest and fastest way.