本文整理汇总了PHP中mysqli::connect_errno方法的典型用法代码示例。如果您正苦于以下问题:PHP mysqli::connect_errno方法的具体用法?PHP mysqli::connect_errno怎么用?PHP mysqli::connect_errno使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类mysqli
的用法示例。
在下文中一共展示了mysqli::connect_errno方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: connect
public function connect($db_host, $db_username, $db_password, $mysql_db)
{
$mysqli1 = new mysqli($db_host, $db_username, $db_password, $mysql_db);
if (mysqli_connect_errno()) {
echo "Connection Failed: " . $mysqli1->connect_errno();
exit;
} else {
return $mysqli1;
}
}
示例2: mysqli
<?php
//Konexioa egin datu-basearekin
//$link = new mysqli("localhost","root","","quiz");
$link = new mysqli("mysql.hostinger.es", "u526113874_rb15", "123456789", "u526113874_quiz");
if ($link->connect_errno) {
die("Huts egin du konexioak MySQL-ra: (" . $link->connect_errno() . ") " . $link->connect_error());
}
$balioak = $link->query("Select * from galdera");
?>
<!DOCTYPE html>
<html>
<head>
<meta name="tipo_contenido" content="text/html;" http-equiv="content-type" charset="utf-8">
<title>Sign Up</title>
<link rel="stylesheet" type="text/css" href="stylesPWS/estiloa.css"/>
<link rel='stylesheet'
type='text/css'
media='only screen and (max-width: 480px)'
href='stylesPWS/smartphone.css' />
<script type="text/javascript" language="javascript" src="funtzioak.js">
</script>
</head>
<body>
<div class ="nav" id="nav">
<ul>
<li class ="ezkerra"><a href ="layout.html">Home</a></li>
<li class ="ezkerra"><a href ="credits.html">Credits</a></li>
<li class ="ezkerra"><a href ="quiz.php">Quizzes</a></li>
</ul>