I am building an application and in that i want the users to install it first, so during installation i want the php script to import my .sql file to automatically setting up database.....any suggestions plz help
You can export the SQL, but you'll probably have to rewrite the raw SQL a bit to being parsed by PHP. The installation isn't that much more than having the user provide his database username / login, and any other specifics - like port, database name etc. So you'll need a form for the user to input information, preferably storing that information in a config-file somewhere, then connect to the database, create the tables, populate them and so on.
$sql= file_get_contents('test.sql'); mysqli_multi_query($sql); //or with PDO $db->query($sql) Code (markup): That works fine for me