Quantcast
Channel: PHP Freaks: PHP Help
Viewing all articles
Browse latest Browse all 13200

very short code [ mysql_result to mysqli please help]

$
0
0

started learning php last week, at first didn't know anything about it so used mysql, now yesterday reading some article i saw that i should be using mysqli instead of mysql, so i changed all the code for my registration and login pages every works fine. However can't figure out the mysql_result to mysqli, couldn't find it on google too

the code:
the error im getting:
Warning: mysql_result() expects parameter 1 to be resource, object given in /Applications/XAMPP/xamppfiles/htdocs/index.php on line 12

<?php
require 'conect.php';

$user_ip = $_SERVER['REMOTE_ADDR'];

function update_count()
{ global $dbconnect;

$query = "SELECT count FROM hits_count";
if ($query_run = mysqli_query($dbconnect, $query))
{
$count = mysql_result($query_run, 0, 'count');
echo $count;
}
}
update_count();
?>

 


Viewing all articles
Browse latest Browse all 13200

Trending Articles