php mysql mysqli object given [duplicate]












-1















This question already has an answer here:




  • mysql_fetch_array()/mysql_fetch_assoc()/mysql_fetch_row()/mysql_num_rows etc… expects parameter 1 to be resource

    31 answers




I am sitting with the strangest problem, and I bet the answer is so simple.
I just can't get my head around it.



$queryHistory = $db->con->query("SELECT * FROM history WHERE script_id = '".$resultScripts->id."' AND buykey = '".$result->key."' AND done = '0'") or die(mysqli_error($db));


What the heck am I doing wrong here?



Warning: mysqli_error() expects parameter 1 to be mysqli, object given in /var/www/html/new_trading/crontab/get_trades.php on line 86


It keeps giving the same error for this line.
I have tested everything, but I can't seem to fix this problem.



Does anybody have a clue what I am doing wrong here?



The output from the two string are also correct, have tested it several times.



Thanks



Wesley










share|improve this question













marked as duplicate by Nick, RiggsFolly mysql
Users with the  mysql badge can single-handedly close mysql questions as duplicates and reopen them as needed.

StackExchange.ready(function() {
if (StackExchange.options.isMobile) return;

$('.dupe-hammer-message-hover:not(.hover-bound)').each(function() {
var $hover = $(this).addClass('hover-bound'),
$msg = $hover.siblings('.dupe-hammer-message');

$hover.hover(
function() {
$hover.showInfoMessage('', {
messageElement: $msg.clone().show(),
transient: false,
position: { my: 'bottom left', at: 'top center', offsetTop: -7 },
dismissable: false,
relativeToBody: true
});
},
function() {
StackExchange.helpers.removeMessages();
}
);
});
});
Nov 12 at 2:42


This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.




















    -1















    This question already has an answer here:




    • mysql_fetch_array()/mysql_fetch_assoc()/mysql_fetch_row()/mysql_num_rows etc… expects parameter 1 to be resource

      31 answers




    I am sitting with the strangest problem, and I bet the answer is so simple.
    I just can't get my head around it.



    $queryHistory = $db->con->query("SELECT * FROM history WHERE script_id = '".$resultScripts->id."' AND buykey = '".$result->key."' AND done = '0'") or die(mysqli_error($db));


    What the heck am I doing wrong here?



    Warning: mysqli_error() expects parameter 1 to be mysqli, object given in /var/www/html/new_trading/crontab/get_trades.php on line 86


    It keeps giving the same error for this line.
    I have tested everything, but I can't seem to fix this problem.



    Does anybody have a clue what I am doing wrong here?



    The output from the two string are also correct, have tested it several times.



    Thanks



    Wesley










    share|improve this question













    marked as duplicate by Nick, RiggsFolly mysql
    Users with the  mysql badge can single-handedly close mysql questions as duplicates and reopen them as needed.

    StackExchange.ready(function() {
    if (StackExchange.options.isMobile) return;

    $('.dupe-hammer-message-hover:not(.hover-bound)').each(function() {
    var $hover = $(this).addClass('hover-bound'),
    $msg = $hover.siblings('.dupe-hammer-message');

    $hover.hover(
    function() {
    $hover.showInfoMessage('', {
    messageElement: $msg.clone().show(),
    transient: false,
    position: { my: 'bottom left', at: 'top center', offsetTop: -7 },
    dismissable: false,
    relativeToBody: true
    });
    },
    function() {
    StackExchange.helpers.removeMessages();
    }
    );
    });
    });
    Nov 12 at 2:42


    This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.


















      -1












      -1








      -1








      This question already has an answer here:




      • mysql_fetch_array()/mysql_fetch_assoc()/mysql_fetch_row()/mysql_num_rows etc… expects parameter 1 to be resource

        31 answers




      I am sitting with the strangest problem, and I bet the answer is so simple.
      I just can't get my head around it.



      $queryHistory = $db->con->query("SELECT * FROM history WHERE script_id = '".$resultScripts->id."' AND buykey = '".$result->key."' AND done = '0'") or die(mysqli_error($db));


      What the heck am I doing wrong here?



      Warning: mysqli_error() expects parameter 1 to be mysqli, object given in /var/www/html/new_trading/crontab/get_trades.php on line 86


      It keeps giving the same error for this line.
      I have tested everything, but I can't seem to fix this problem.



      Does anybody have a clue what I am doing wrong here?



      The output from the two string are also correct, have tested it several times.



      Thanks



      Wesley










      share|improve this question














      This question already has an answer here:




      • mysql_fetch_array()/mysql_fetch_assoc()/mysql_fetch_row()/mysql_num_rows etc… expects parameter 1 to be resource

        31 answers




      I am sitting with the strangest problem, and I bet the answer is so simple.
      I just can't get my head around it.



      $queryHistory = $db->con->query("SELECT * FROM history WHERE script_id = '".$resultScripts->id."' AND buykey = '".$result->key."' AND done = '0'") or die(mysqli_error($db));


      What the heck am I doing wrong here?



      Warning: mysqli_error() expects parameter 1 to be mysqli, object given in /var/www/html/new_trading/crontab/get_trades.php on line 86


      It keeps giving the same error for this line.
      I have tested everything, but I can't seem to fix this problem.



      Does anybody have a clue what I am doing wrong here?



      The output from the two string are also correct, have tested it several times.



      Thanks



      Wesley





      This question already has an answer here:




      • mysql_fetch_array()/mysql_fetch_assoc()/mysql_fetch_row()/mysql_num_rows etc… expects parameter 1 to be resource

        31 answers








      php mysql






      share|improve this question













      share|improve this question











      share|improve this question




      share|improve this question










      asked Nov 12 at 1:57









      Wesley Schravendijk

      369




      369




      marked as duplicate by Nick, RiggsFolly mysql
      Users with the  mysql badge can single-handedly close mysql questions as duplicates and reopen them as needed.

      StackExchange.ready(function() {
      if (StackExchange.options.isMobile) return;

      $('.dupe-hammer-message-hover:not(.hover-bound)').each(function() {
      var $hover = $(this).addClass('hover-bound'),
      $msg = $hover.siblings('.dupe-hammer-message');

      $hover.hover(
      function() {
      $hover.showInfoMessage('', {
      messageElement: $msg.clone().show(),
      transient: false,
      position: { my: 'bottom left', at: 'top center', offsetTop: -7 },
      dismissable: false,
      relativeToBody: true
      });
      },
      function() {
      StackExchange.helpers.removeMessages();
      }
      );
      });
      });
      Nov 12 at 2:42


      This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.






      marked as duplicate by Nick, RiggsFolly mysql
      Users with the  mysql badge can single-handedly close mysql questions as duplicates and reopen them as needed.

      StackExchange.ready(function() {
      if (StackExchange.options.isMobile) return;

      $('.dupe-hammer-message-hover:not(.hover-bound)').each(function() {
      var $hover = $(this).addClass('hover-bound'),
      $msg = $hover.siblings('.dupe-hammer-message');

      $hover.hover(
      function() {
      $hover.showInfoMessage('', {
      messageElement: $msg.clone().show(),
      transient: false,
      position: { my: 'bottom left', at: 'top center', offsetTop: -7 },
      dismissable: false,
      relativeToBody: true
      });
      },
      function() {
      StackExchange.helpers.removeMessages();
      }
      );
      });
      });
      Nov 12 at 2:42


      This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.


























          1 Answer
          1






          active

          oldest

          votes


















          2














          mysqli_error($db->con)


          The con is a mysqli object and that is what the method expects at the parameter






          share|improve this answer

















          • 1




            Thank you! I knew the answer was going to be so easy. The help is highly appreciated!
            – Wesley Schravendijk
            Nov 12 at 2:03












          • You can directly use $db->error instead of mysqli_error($db->con)
            – Nilesh Daladra
            Nov 12 at 8:27










          • In his case it would be $db->con->error. con is his mysqli object.
            – Mohammad C
            Nov 12 at 12:08


















          1 Answer
          1






          active

          oldest

          votes








          1 Answer
          1






          active

          oldest

          votes









          active

          oldest

          votes






          active

          oldest

          votes









          2














          mysqli_error($db->con)


          The con is a mysqli object and that is what the method expects at the parameter






          share|improve this answer

















          • 1




            Thank you! I knew the answer was going to be so easy. The help is highly appreciated!
            – Wesley Schravendijk
            Nov 12 at 2:03












          • You can directly use $db->error instead of mysqli_error($db->con)
            – Nilesh Daladra
            Nov 12 at 8:27










          • In his case it would be $db->con->error. con is his mysqli object.
            – Mohammad C
            Nov 12 at 12:08
















          2














          mysqli_error($db->con)


          The con is a mysqli object and that is what the method expects at the parameter






          share|improve this answer

















          • 1




            Thank you! I knew the answer was going to be so easy. The help is highly appreciated!
            – Wesley Schravendijk
            Nov 12 at 2:03












          • You can directly use $db->error instead of mysqli_error($db->con)
            – Nilesh Daladra
            Nov 12 at 8:27










          • In his case it would be $db->con->error. con is his mysqli object.
            – Mohammad C
            Nov 12 at 12:08














          2












          2








          2






          mysqli_error($db->con)


          The con is a mysqli object and that is what the method expects at the parameter






          share|improve this answer












          mysqli_error($db->con)


          The con is a mysqli object and that is what the method expects at the parameter







          share|improve this answer












          share|improve this answer



          share|improve this answer










          answered Nov 12 at 2:01









          Mohammad C

          1,1831312




          1,1831312








          • 1




            Thank you! I knew the answer was going to be so easy. The help is highly appreciated!
            – Wesley Schravendijk
            Nov 12 at 2:03












          • You can directly use $db->error instead of mysqli_error($db->con)
            – Nilesh Daladra
            Nov 12 at 8:27










          • In his case it would be $db->con->error. con is his mysqli object.
            – Mohammad C
            Nov 12 at 12:08














          • 1




            Thank you! I knew the answer was going to be so easy. The help is highly appreciated!
            – Wesley Schravendijk
            Nov 12 at 2:03












          • You can directly use $db->error instead of mysqli_error($db->con)
            – Nilesh Daladra
            Nov 12 at 8:27










          • In his case it would be $db->con->error. con is his mysqli object.
            – Mohammad C
            Nov 12 at 12:08








          1




          1




          Thank you! I knew the answer was going to be so easy. The help is highly appreciated!
          – Wesley Schravendijk
          Nov 12 at 2:03






          Thank you! I knew the answer was going to be so easy. The help is highly appreciated!
          – Wesley Schravendijk
          Nov 12 at 2:03














          You can directly use $db->error instead of mysqli_error($db->con)
          – Nilesh Daladra
          Nov 12 at 8:27




          You can directly use $db->error instead of mysqli_error($db->con)
          – Nilesh Daladra
          Nov 12 at 8:27












          In his case it would be $db->con->error. con is his mysqli object.
          – Mohammad C
          Nov 12 at 12:08




          In his case it would be $db->con->error. con is his mysqli object.
          – Mohammad C
          Nov 12 at 12:08



          這個網誌中的熱門文章

          Tangent Lines Diagram Along Smooth Curve

          Yusuf al-Mu'taman ibn Hud

          Zucchini