本文整理汇总了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;
}