本文整理匯總了PHP中control::database方法的典型用法代碼示例。如果您正苦於以下問題:PHP control::database方法的具體用法?PHP control::database怎麽用?PHP control::database使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類control
的用法示例。
在下文中一共展示了control::database方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: control
<?php
session_start();
/*$_SESSION["product_sh"];
*/
include_once "modify_shopping_start.php";
/*if(!isset($_SESSION["product_sh"])) {
header("login_front_trial1.php");
}else { */
if (isset($_POST["maybe_buy"])) {
$obj = new control();
$hostname = "localhost";
$username = "root";
$password = "";
$database = "student";
$obj->database($hostname, $username, $password, $database);
$code = $_GET["code"];
$result = $obj->select("SELECT * from register where code='{$code}'");
/* }
*/
}
?>
<!DOCTYPE html >
<html>
<head>
<title>Add to cart</title>
<style>
th, td {text-align:center;
color:#000;
}
</style>
示例2: control
<?php
session_start();
/*$_SESSION["product_sh"];
*/
require_once "modify_shopping_start.php";
$call_class = new control();
$hostname = "localhost";
$username = "root";
$password = "";
$database = "student";
$call_class->database($hostname, $username, $password, $database);
$check_val = $call_class->select("SELECT * from add_product ");
//$bring =mysql_fetch_array($check);
?>
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>login front1</title>
<style>
.product {
background-color: antiquewhite;
color: #cf9c03;
font-size: 28px;
margin: -1px;
padding: 0;
text-align: center;
text-decoration: blink;
}