i seriously dont understand why the following dumps me bool(false)
// Create connection
$conn = mysqli_connect($servername, $username, $password);
// Check connection
if (!$conn) {
die("Connection failed: " . mysqli_connect_error());
}
echo "Connected successfully";
$sql = "SELECT id FROM maxims ORDER BY RAND() LIMIT 1";
var_dump(mysqli_query($conn, $sql)) or die(mysql_error());
mysqli_connect("myhost","myuser","mypassw","mydb");
e.g
$conn = mysqli_connect('localhost','user','password','database1');
http://php.net/manual/en/function.mysqli-connect.php
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With