I'm running in an issue with $mysqli->real_connect
. new mysqli
is working fine but $mysqli->real_connect
brings the following error message.
Fatal error: Uncaught Error: Call to a member function prepare() on bool
I don't finde realy much information about $mysqli->real_connect
. Anny suggestion what i can do?
<?php
$mysqli = mysqli_init();
$hostaddress = 'xxxxxxx.xxxx';
$db = "xxxxxxxxx";
$username = "xxxxxxxx";
$port = "xxxxx";
$pass = "xxxxxxxxx";
$mysqli->options(MYSQLI_OPT_SSL_VERIFY_SERVER_CERT, true);
$mysqli->ssl_set( "xxxxxxxxxxxxxxx", "xxxxxxxxxxxxx", "xxxxxxxxxxxxxxxxxx" , NULL, NULL );
$conn = $mysqli->real_connect( $hostaddress, $username, $pass, $db, $port );
$conn= new mysqli( $hostaddress, $username, $pass, $db, $port );
?>
Solution:
<?php
$conn = mysqli_init();
$hostaddress = 'xxxxxxx.xxxx';
$db = "xxxxxxxxx";
$username = "xxxxxxxx";
$port = "xxxxx";
$pass = "xxxxxxxxx";
$conn->options(MYSQLI_OPT_SSL_VERIFY_SERVER_CERT, true);
$conn->ssl_set( "xxxxxxxxxxxxxxx", "xxxxxxxxxxxxx", "xxxxxxxxxxxxxxxxxx" , NULL, NULL );
$conn->real_connect( $hostaddress, $username, $pass, $db, $port );
?>