mysqli_select_db($link, "test");
- $stmt = mysqli_prepare($link, "SELECT current_user(), database(), 'foo'");
+ $stmt = mysqli_prepare($link, "SELECT md5('bar'), database(), 'foo'");
mysqli_bind_result($stmt, $c0, $c1, $c2);
mysqli_execute($stmt);
mysqli_fetch($stmt);
mysqli_stmt_close($stmt);
- $c0 = ($c0 == $user . "@" . $host) ? 1 : 0;
-
$test = array($c0, $c1, $c2);
var_dump($test);
--EXPECT--
array(3) {
[0]=>
- int(1)
+ string(32) "37b51d194a7513e45b56f6524f2d51f2"
[1]=>
string(4) "test"
[2]=>
$mysql = mysqli_connect($host, $user, $passwd);
$mysql->select_db("test");
- $result = $mysql->query("SELECT CURRENT_USER()");
+ $result = $mysql->query("SELECT DATABASE()");
$row = $result->fetch_row();
$result->close();
- $ok = ($row[0] == $user . "@" . $host);
- var_dump($ok);
+ var_dump($row);
$mysql->close();
?>
--EXPECT--
-bool(true)
+array(1) {
+ [0]=>
+ string(4) "test"
+}
public function connect() {
include "connect.inc";
- $link = mysqli::connect($host, $user, $passwd);
+ $link = mysqli_connect($host, $user, $passwd);
var_dump($link);
- $link = mysqli::init();
+ $link = mysqli_init();
var_dump($link);
$mysql = new mysqli($host, $user, $passwd, "test");