php - Mysql query on SQL file -


how can use mysql querys on sql file on custom path? file contain db or table.

for example this:

// file contain db $mysqli = new mysqli('../myfolder/mydb.sql', 'user', 'pass'); $mysqli -> query("select * table");  // file contain table  $mysqli = new mysqli('../myfolder/mytable.sql', 'user', 'pass'); $mysqli -> query("select * table"); 

the .sql file contains sql commands; need run create database, , can use mysqli connect database.


Comments

Popular posts from this blog

java - unable show chart in xls document using jasper reports -

javascript - How to change image src on success AJAX -

java.lang.RuntimeException: Could not generate dummy secret at sun.security.ssl.RSAClientKeyExchange.<init> -