Mysql to mysqli,need help.

Fatal error: Call to undefined function mysqli_result()

[php]function has_access($user_id, $type) {
$user_id = (int)$user_id;
$type = (int)$type;
global $mysqli;
return (mysqli_result($mysqli->query(“SELECT COUNT(user_id) FROM users WHERE user_id = ‘$user_id’ AND type = $type”), 0) == 1) ? true : false;

Could anyone rewrite into correct code?

I have lots and lots of code to convert,if anyone could help this weekend my skype is: greatempire123
I can even pay you for your help.

You are mixing procedural and object oriented mysqli, stick to using one of them (preferably oop).

Also you shouldn’t concatenate variables into the queries, use parameterized queries!

i’ve seen manual 100 times,its no help,and everything you just said to me i understood as good as i would understand ‘‘bla bla bla’’ =(

Then either

A) let it be for a while, it helps some times to get some distance to a problem. Sitting with it for hours can sometimes make you blind for solutions.

B) post it in the coder for hire section and pay someone to do your work.

Thank you! Already sent few letters to professional php workers.Maybe you wanna take a look at my website,if you convert it i can pay you!

Sponsor our Newsletter | Privacy Policy | Terms of Service