kylek
07-09-2015, 07:23 PM
I have an addon product that worked in php4 but we upgraded to php5 and most of it works except for 1 error showing at top of page. I have no knowledge of php but am trying to learn.
This is the error we are getting:
Warning: mysql_num_rows() expects parameter 1 to be resource, boolean given in /home/xxxx/xxx/pickem/includes/header.php on line 122This is line 122 header.php:
if (mysql_num_rows($query)) {Using http://phpcodechecker.com/ I checked line 119 to line 129:
$sql = "select * from " . $db_prefix . "users where userID = " . $user->userID;
$query = mysql_query($sql);
if (mysql_num_rows($query)) {
$result = mysql_fetch_array($query);
$template_name = $result['template_name'];
}
if (!empty($_POST['template_name'])) $template_name = $_POST['template_name'];
?>Results:
Warning: There are 3 functions in your code that have been deprecated in the current version of PHP :
mysql_fetch_array()
mysql_num_rows()
mysql_query()
Any ideas on what may work?
This is the error we are getting:
Warning: mysql_num_rows() expects parameter 1 to be resource, boolean given in /home/xxxx/xxx/pickem/includes/header.php on line 122This is line 122 header.php:
if (mysql_num_rows($query)) {Using http://phpcodechecker.com/ I checked line 119 to line 129:
$sql = "select * from " . $db_prefix . "users where userID = " . $user->userID;
$query = mysql_query($sql);
if (mysql_num_rows($query)) {
$result = mysql_fetch_array($query);
$template_name = $result['template_name'];
}
if (!empty($_POST['template_name'])) $template_name = $_POST['template_name'];
?>Results:
Warning: There are 3 functions in your code that have been deprecated in the current version of PHP :
mysql_fetch_array()
mysql_num_rows()
mysql_query()
Any ideas on what may work?