當前位置: 首頁>>代碼示例>>PHP>>正文


PHP mysqli::mysqli_connect_error方法代碼示例

本文整理匯總了PHP中mysqli::mysqli_connect_error方法的典型用法代碼示例。如果您正苦於以下問題:PHP mysqli::mysqli_connect_error方法的具體用法?PHP mysqli::mysqli_connect_error怎麽用?PHP mysqli::mysqli_connect_error使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在mysqli的用法示例。


在下文中一共展示了mysqli::mysqli_connect_error方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: bdm

 public static function bdm($nombre, $ap, $am, $com, $filename)
 {
     $hostname = 'http://www.meetingrooms.com.mx';
     $database = 'meetingr_qr';
     $username = 'meetingr_qradmin';
     $password = 'Qradmin123';
     $mysqli = new mysqli($hostname, $username, $password, $database);
     if ($mysqli->connect_errno) {
         die("Fallo la conexion a MySQL: (" . $mysqli->mysqli_connect_errno() . ") " . $mysqli->mysqli_connect_error());
     } else {
         $filename = $filename . '.png';
     }
     if ($mysqli->query("INSERT INTO qr (Nombre,ApellidoP,ApellidoM,Comentario,img) values('{$nombre}','{$ap}','{$am}','{$com}','{$filename}')") === TRUE) {
         printf($mysqli->affected_rows);
     } else {
         echo "Error al ejecutar el comando:" . $mysqli->error;
     }
 }
開發者ID:andresmayahii,項目名稱:demomactrainee,代碼行數:18,代碼來源:bd.php

示例2: mysqli

 * User: terminator10
 * Date: 3/11/15
 * Time: 21:54
 */
header("Content-type: text/html; charset=utf8");
include 'ez_sql_core.php';
include 'ez_sql_mysql.php';
//$con = new ezSQL_mysql('root','','whereis','localhost');
$hostname = 'localhost';
$database = 'whereis_pma';
$username = 'root';
$password = '';
//MySQLi
$mysqli = new mysqli($hostname, $username, $password, $database);
if ($mysqli->connect_errno) {
    die("Fallo la conexión a MySQL: (" . $mysqli->mysqli_connect_errno() . ") " . $mysqli->mysqli_connect_error());
} else {
    session_start();
    if (!empty($_SESSION["user"])) {
        $username = $_SESSION["user"];
    }
    $data = "SELECT * FROM user_wis\n             INNER JOIN photo_user_wis ON (photo_user_wis.photo = user_wis.photo)\n             INNER JOIN places ON (places.id = user_wis.you_lives)\n             INNER JOIN provincewis ON (provincewis.id_proWis = user_Wis.province)\n            WHERE user_wis.Username = '{$username}' ";
    $row_data = $mysqli->query($data);
    while ($fi = $row_data->fetch_array()) {
        $username = $fi["Username"];
        $name = $fi["last_name"];
        $email = $fi["email"];
        $you_lives = $fi["places"];
        $lives = $fi["id"];
        $photo = $fi["url_photo"];
        $id_photo = $fi["photo"];
開發者ID:Bolhy10,項目名稱:WhereIs,代碼行數:31,代碼來源:conex_whereis.php

示例3: mysqli

		.day-number{color:white;}.day 
		.events{color:white;
		margin: 22px 7px 5px;
		height:78px;
		overflow-x:hidden;
		overflow-y:hidden;}.day 
		.events h5{margin:0 0 5px;
		overflow:hidden;text-overflow:ellipsis;
		white-space:nowrap;width:100%;}.day .events strong,.day .events span{display:block;font-size:8px;}.day .events ul{}.day .events li{}</style>
    </head>
    <body Background="imagenes\fondo.jpg">
	<div class="calendar">
    <?php 
$mysqli = new mysqli('localhost', 'root', '1234', 'empresalogistica');
if ($mysqli->connect_errno) {
    die($mysqli->mysqli_connect_error());
}
$result = $mysqli->query('SELECT * FROM viaje');
if (!$result) {
    die($mysqli->error);
}
$events = array();
while ($row = $result->fetch_assoc()) {
    $start_date = new DateTime($row['fecha_partida']);
    $end_date = new DateTime($row['fecha_llegada']);
    $day = $start_date->format('j');
    $events[$day][] = array('start_hour' => $start_date->format('G:i a'), 'end_hour' => $end_date->format('G:i a'), 'description' => $row['tipo_carga']);
}
$datetime = new DateTime();
// mes en texto
$txt_months = array('Enero', 'Febrero', 'Marzo', 'Abril', 'Mayo', 'Junio', 'Julio', 'Agosto', 'septiembre', 'Octubre', 'Noviembre', 'Diciembre');
開發者ID:julianbutron,項目名稱:tp,代碼行數:31,代碼來源:calendario.php


注:本文中的mysqli::mysqli_connect_error方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。