This question already has an answer here:
I am not really familiar with mysqli
that much, and I have to upgrade my script to mysqli
, please could you help me sort it?
I have this
function getConnected($host,$db_user,$db_password,$db) {
$mysqli = new mysqli($host, $db_user, $$db_password, $db);
if($mysqli->connect_error)
die('Connect Error (' . mysqli_connect_errno() . ') '. mysqli_connect_error());
return $mysqli;
}
$mysqli = getConnected("localhost", "user_name_data456", "password123456", "user_database456");
and my query
mysqli_query($mysqli,$sql);
mysqli_query($mysqli,$sql2);
mysqli_query($mysqli,$sql3);
mysqli_query($mysqli,$sql4);
mysqli_query($mysqli,$sql5);
The queries sql1 - 5 are working fine, it just has some insert things, I know doing more queries on mysql or mysqli isn't recommended, but I am just too tired.
Please help me sort it out. :/
</div>