httpd/tests/httpd-php-mysql-sanity-test/new_mysql.php

13 lines
318 B
PHP
Raw Normal View History

2017-11-16 10:27:52 +00:00
<?php
$db = mysqli_connect("localhost", "root");
if (!$db) {
die("Could not connect");
}
if (!mysqli_select_db($db, "php_mysql_test")) {
die("Could not select database");
}
$res = mysqli_query($db, "SELECT * from foobar");
$row = mysqli_fetch_assoc($res);
printf("%s is %d\n", $row['name'], $row['value']);
?>