Originally Said By: Ray Borduin
You can simply turn off that Depricated message and ignore it for now. You would only be forced to update your code when you go to a php7 server... this is just a warning.
To upgrade you just have to install DataBridge 2 and then open any Recordsets, Insert, Update, and Delete Server behaviors on the page and switch them to the MySQLi connection. Once you click OK with a MySQLi connection, then the code is updated to MySQLi.
I did this, and it does update my DB connection to MySQLi, however every page that uses that connection now throws up the following errors causing my pages to not display at all:
Warning: mysql_select_db() expects parameter 2 to be resource, object given in /home/content/29/8748029/html/index.php on line 39
Warning: mysql_query() expects parameter 2 to be resource, object given in /home/content/29/8748029/html/index.php on line 41
those lines are part of the following function on the pages:
<?php
if (!function_exists("GetSQLValueString")) {
function GetSQLValueString($theValue, $theType, $theDefinedValue = "", $theNotDefinedValue = "")
{
if (PHP_VERSION < 6) {
$theValue = get_magic_quotes_gpc() ? stripslashes($theValue) : $theValue;
}
$theValue = function_exists("mysql_real_escape_string") ? mysql_real_escape_string($theValue) : mysql_escape_string($theValue);
switch ($theType) {
case "text":
$theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
break;
case "long":
case "int":
$theValue = ($theValue != "") ? intval($theValue) : "NULL";
break;
case "double":
$theValue = ($theValue != "") ? doubleval($theValue) : "NULL";
break;
case "date":
$theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
break;
case "defined":
$theValue = ($theValue != "") ? $theDefinedValue : $theNotDefinedValue;
break;
}
return $theValue;
}
}mysql_select_db($database_conn_inventory, $conn_inventory);
$query_WADAusedbikes = "SELECT * FROM usedbikes WHERE new_or_used = 'Used' AND usedbikes.Status = 'In Inventory' ORDER BY ModelYear DESC, Importance DESC LIMIT 12";
$WADAusedbikes = mysql_query($query_WADAusedbikes, $conn_inventory) or die(mysql_error());
$row_WADAusedbikes = mysql_fetch_assoc($WADAusedbikes);
$totalRows_WADAusedbikes = mysql_num_rows($WADAusedbikes);
?>
Line 39 refers to: }mysql_select_db($database_conn_inventory, $conn_inventory);
Line 41refers to: $WADAusedbikes = mysql_query($query_WADAusedbikes, $conn_inventory) or die(mysql_error());