PHP code instance for importing SQL script file into MySQL

time:14-10-07 forum:PHP tools and code
  Reprinted from http://www.jb51.net/article/48187.htm

usually used to make installers, data backup programs to use this code, I see there are not too many, and some are not very good use, sometimes this code can be used directly to save a lot of time, then I from the stackov Erflow has turned one. The required friends can refer to the following
code as follows:
[code].lt;? Php

/ / / / Name of the file
$filename ='churc.sql'; />$mysql_password = '';
/ / / / / / Database name
$mysql_database ='dump';

/ / Connect to MySQL server
/ / Temporary variable. 's a comment
if (substr ($line, 0, 2) = = '$line = =')
continue;

/ / / / / / / > = = '='; The query
mysql_query ($templine) or print ('Error performing query \'.lt; strong.gt; $templine. >?.gt; [/code]

prev:Furong street and Qu Shui Ting Street in... next:PHP garbled problem, UTF-8 (garbled), ve...
post comment
Notice



approved   Have you ever eaten steamed pagoda f...   93 year old math professor returns t...   Good dad's 7 standards, all perfect!   The son spoke softly, afraid of skin...   After 50 years of age, it is difficu...
rand   PHP random number generation and use...   Talk about 10 MySQL mistakes that PH...   10 MySQL errors that PHP developers ...   Eliminate 3 Chinese characters from ...   Importing large databases to virtual...
ads

other

Because all the contents of this site are reproduced from other media, the intention is to provide free services to the public, but it does not mean that this site agrees with its views, and can not be responsible for the authenticity of its verification, such as the copyright unit or individual of the manuscript does not want to publish on this site, please Contact me, I will immediately remove it, thank you. Contact: atseashawk@163.com