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

Source: Internet
Author: User
Tags mysql query mysql tutorial pconnect php tutorial

<?php Tutorial


$dbhost = ' localhost '; Database Tutorial Server
$dbuser = ' root '; Database user Name
$DBPW = ' QWASZX '; Database Password
$dbname = ' movie '; Database name
$adminemail = www.111cn.net@111cn.net; System Administrator Email


$database = ' MySQL tutorial '; Cannot modify here
$tplrefresh = 1; Template Auto Refresh Switch 0 = close, 1 = Open
$pconnect = 0; Database connection mode 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 |<br>"; Debug
//@fwrite ($globals [FP], $sql. " "); Debug
$query = mysql_query ($sql);
echo ' query: '. $query. ' <br> ';
if (! $query &&! $silence)
{
$this->halt (' MySQL query error ', $sql);
}
$this->querynum++;
return $query;
}

Related Article

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.