Warning: mysql_fetch_object(): supplied argument is not a valid MySQL result resource in C:\xampp\htdocs\update.php on line 14 -


this question has answer here:

i'm getting error on gambling site, it's on progressbar error occurs.

warning: mysql_fetch_object(): supplied argument not valid mysql result resource in c:\xampp\htdocs\update.php on line 14

update.php:

<?php if(session_id() == '') { session_start(); } ?> <?php try {             $apikey = "c897813f4999af1eda50aeecfd9eccfe";                 $servername = "127.0.0.1";                 $username = "root";                 $password = "admin123";                 $dbname = "skingamble";      $conn = new mysqli($servername, $username, $password, $dbname);     $result = $conn->query("select * `keys`");     $row = $result->fetch_assoc();     $result2 = $conn->query("select * `current`");     $count = mysql_fetch_object($result2);     echo $count;     echo 'deposited keys: ' . $count . " / " . $row["max"];     if($count=="0" || $row["max"]=="0")     {         echo "<script>progress(0)</script>";     }     else     {         echo "<script>progress(". $count . "/(" .$row["max"] ."/ 100))</script>";     }      if($count>=$row["max"])     {         $result = $conn->query("select * current order rand() limit 1");         $row = $result->fetch_assoc();         $winner = $row["steamid"];         $result2 = $conn->query("select * steamids steamid='" . $winner . "' limit 1");         $roww = $result2->fetch_assoc();         $token = $roww["tradetoken"];         $conn->query("insert `actions` (`token`, `steamid`) values ('" . $token . "', '" . $winner . "');");         $conn->query("insert `items` (`user`, `action`) values ('" . $winner . "','win');");         $conn->query("insert `log` (`text`, `id`,`type`) values ('<b>winner!</b> " . $row["name"] . " won round!','', 'win');");         $conn->query("truncate current;");      }      $conn->close(); } catch (exception $e) {  }  ?> 

you using mysqli queries...

then, mysql_fetch_object not work correctly because passing stuff not mysql mysqli.

replace

mysql_fetch_object();

with

mysqli_fetch_object();

you can use or mysql or mysqli , once have choosed you'll have use during code


Comments

Popular posts from this blog

asp.net mvc - SSO between MVCForum and Umbraco7 -

Python Tkinter keyboard using bind -

ubuntu - Selenium Node Not Connecting to Hub, Not Opening Port -