Afetr updating php on the server i have some problems with mysql_query. There are 2 functions in your code that have been deprecated in the current version of PHP : mysql_fetch_
mysql_query return
a resource. So you get this error by using $wpdb->get_results
.
mysql_query() returns TRUE
on success or FALSE
on error
. The returned result resource should be passed to mysql_fetch_array()
, and other functions for dealing with result tables, to access the returned data.
You will replace 2 function mysql_fetch_array()
and mysql_query
instance of $wpdb->get_results. You will define return type -- ARRAY_A, ARRAY_N , OBJECT ,OBJECT_K
global $wpdb;
$ck_sql = $wpdb->get_results("SELECT ck_ips, ck_rating_up, ck_rating_down FROM `$table_name` WHERE ck_comment_id = $comment_id", ARRAY_A);
foreach($ck_sql as $row) {
echo $row['ck_ips'] . ' ' . $row['ck_rating_up']. ' ' . $row['ck_rating_down '];
}