Hi
I've been using mysqli and recently moved a website to a new server hosting company. They have recently informed me that the version of PHP they use does not support mysqli.
I'm not really sure about the why/why not's etc but could I just change all instances of mysqli to mysql and get the same results?
Many thanks for any advice on this...
// Connect to the database
$dbc = mysqli_connect("host", "username", "password", "dbname");
// Grab the user-entered log-in data
$user_username = mysqli_real_escape_string($dbc, trim($_SERVER['PHP_AUTH_USER']));
$user_password = mysqli_real_escape_string($dbc, trim($_SERVER['PHP_AUTH_PW']));
// Look up the username and password in the database
$query = "SELECT reg_id, username FROM user_registration WHERE username = '$user_username' AND password = SHA('$user_password')";
$data = mysqli_query($dbc, $query);
if (mysqli_num_rows($data) == 1) {
// The log-in is OK so set the user ID and username variables
$row = mysqli_fetch_array($data);
$reg_id = $row['reg_id'];
$username = $row['username'];