本文整理汇总了PHP中MySQLDatabase::dbconnect方法的典型用法代码示例。如果您正苦于以下问题:PHP MySQLDatabase::dbconnect方法的具体用法?PHP MySQLDatabase::dbconnect怎么用?PHP MySQLDatabase::dbconnect使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类MySQLDatabase
的用法示例。
在下文中一共展示了MySQLDatabase::dbconnect方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: MySQLDatabase
if (ord(substr($string, $i, 1)) > 129) {
$i++;
}
}
if (strlen($tmpstr) < $strlen) {
$tmpstr .= "...";
}
return $tmpstr;
}
}
$dbhost = '119.254.229.23';
$dbuser = 'root';
$dbpass = '123456';
$dbname = 'osscms';
$dbport = 3306;
$dbinst = new MySQLDatabase();
$dbinst->dbconnect($dbhost, $dbuser, $dbpass, $dbname);
$dbinst->query("SET NAMES utf8");
$divstr = "<html><html xmlns=\"http://www.w3.org/1999/xhtml\"><head> \n<meta http-equiv=\"content-type\" content=\"text/html; charset=UTF-8\">\n<title></title>\n<link href=\"http://soft.csip.org.cn/css/style.css\" rel=\"stylesheet\" type=\"text/css\" >\n<link href=\"http://soft.csip.org.cn/css/layout.css\" rel=\"stylesheet\" type=\"text/css\" >\n<style type=\"text/css\" >\nbody {\n\tcolor:#333333;\n\tfont-family:\"宋体\" arial;\n\tfont-size:12px;\n\tfont-size-adjust:none;\n\tfont-style:normal;\n\tfont-variant:normal;\n\tfont-weight:normal;\n}\n\n.m03_a_bt a {\n\twidth:280px;\n\tline-height:24px;\n\tfont-size: 12px;\n}\n.nd {font-size:12px;}\n.m03_a_bt a:link, .m03_a_bt a:visited { font-size:12px; color: #333333; text-decoration: none;}\n.m03_a_bt a:hover { font-size:12px; color:#f00;\t}\n\n</style>\n</head>\n<body>";
$divstr .= "<div> <table class=\"m03_a_bt\" width=\"290\" border=\"0\" cellspacing=\"0\" cellpadding=\"0\">";
$strSQL = sprintf("SELECT itemid, subject FROM oss_spaceitems WHERE folder=1 ORDER BY lastpost DESC limit 0, 7");
$result = $dbinst->query($strSQL);
while ($myrow = $dbinst->fetchArray($result)) {
$news_url = "http://oss.org.cn/?action-viewnews-itemid-" . $myrow['itemid'];
$news_subject = cutText($myrow['subject'], 0, 30, 'UTF-8') . "...";
$divstr .= "<tr><td width=\"290\" ><a href=\"{$news_url}\" target=\"_blank\" >{$news_subject}</a></td></tr>";
}
$dbinst->freeRecordSet($result);
$divstr .= "</table></div></body></html>";
echo $divstr;
exit;
示例2: sprintf
'dateline' => $curtimestamp,
'updatetime' => $curtimestamp,
'lastlogin' => $curtimestamp,
'ip' => '172.16.23.88'
);
$strSQL = sprintf("
REPLACE INTO oss_members (uid,username,groupid,password,dateline,updatetime,lastlogin,ip)
VALUES (%d,%s,%d,%s,%d,%d,%d,%s)",
};
***/
$curtimestamp = time();
//$pass = $uid | $curtimestamp;
$dst_db = new MySQLDatabase();
$dst_db->dbconnect($dst_dbhost, $dst_dbuser, $dst_dbpass, 'uchome');
$userlist = array();
$src_db = new MySQLDataBase();
$src_db->dbconnect($src_dbhost, $src_dbuser, $src_dbpass, $src_dbname);
$strSQL = sprintf("SELECT uid, username,password,email,regip, regdate FROM uc_members ");
$result = $src_db->query($strSQL);
while ($myrow = $src_db->fetchArray($result)) {
/*
$user['uid'] = $myrow['uid'];
$user['username'] = $myrow['username'];
$user['password'] = $myrow['password'];
$user['email'] = $myrow['email'];
$user['regip'] = $myrow['regip'];
$user['regdate'] = $myrow['regdate'];
*/
/*