Php instance movie file verification download code (1/3)-PHP source code

Source: Internet
Author: User
Tags pconnect
Ec (2); & lt ;? Php tutorial & nbsp; $ dbhostlocalhost; & nbsp; database tutorial Server & nbsp; $ dbuserroot; & nbsp; database username & nbsp; $ dbpwqwaszx; & nbsp; script ec (2); script


$ Dbhost = 'localhost'; // database tutorial Server
$ Dbuser = 'root'; // database username
$ Dbpw = 'qwaszx'; // Database Password
$ Dbname = 'movie '; // Database Name
$ Adminemail = www.111cn.net@111cn.net; // System Administrator email


$ Database = 'mysql example'; // you cannot modify it here.
$ Tplrefresh = 1; // The automatic template refresh switch 0 = off, 1 = on
$ Pconnect = 0; // database connection method 0 = connect, 1 = pconnect

// ================================================ ==============================================

Class db_class {
Var $ querynum = 0;
// Function dbstuff () {global $ fp; $ fp = fopen ("./tempdata/dblog.txt", "w ");}

Function connect ($ dbhost, $ dbuser, $ dbpw, $ dbname, $ pconnect = 0 ){
If ($ pconnect ){
If (! @ Mysql_pconnect ($ dbhost, $ dbuser, $ dbpw )){
$ This-> halt ('can not connect to mysql Server ');
}
} Else {
If (! @ Mysql_connect ($ dbhost, $ dbuser, $ dbpw )){
$ This-> halt ('can not connect to mysql Server ');
}
}
Mysql_query ("set names 'gb2312 '");
}

Function select_db ($ dbname ){
Return mysql_select_db ($ dbname );
}

Function fetch_array ($ query, $ result_type = mysql_assoc ){


$ Query = mysql_fetch_array ($ query, $ result_type );

Return $ query;
}

Function query ($ SQL, $ silence = 0 ){
// Echo "| $ SQL |
"; // Debug
// @ Fwrite ($ globals [fp], $ SQL. ""); // debug
$ Query = mysql_query ($ SQL );
// Echo 'query: '. $ query .'
';
If (! $ Query &&! $ Silence)
{
$ This-> halt ('mysql query error', $ SQL );
}
$ This-> querynum ++;
Return $ query;
}

Homepage 1 2 3 last

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.