##################################################################### | |
###################### Base fonctions mysqli #################### | |
##################################################################### | |
$mysqli = new mysqli("[host]", "[user]", "[passwd]", "[database]"); | |
if ($mysqli->connect_errno) { | |
echo "Failed to connect to MySQL : (" . $mysqli->connect_errno . ") " . $mysqli->connect_error; | |
} | |
function mysqli_return_number( $mysqli, $req ){ | |
$row_cnt = 0; | |
if ( $result = $mysqli->query( "$req" ) ) { | |
$row_cnt = $result->num_rows; | |
$result->close(); | |
} | |
return $row_cnt; | |
} | |