having lots of issue to connect function to mysqli database if you can hep me i will be great full to you . Please help me
1 Answers
you can try this solution
function getConnected($host,$user,$pass,$db) {
$mysqli = new mysqli($host, $user, $pass, $db);
if($mysqli->connect_error)
die('Connect Error (' . mysqli_connect_errno() . ') '. mysqli_connect_error());
return $mysqli; }
for example
$mysqli = getConnected('localhost','user','password','database');
Please login or Register to submit your answer
Author - comments - 0