php mysql mysqli object given [duplicate]
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
php mysql
marked as duplicate by Nick, RiggsFolly
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.
add a comment |
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
php mysql
marked as duplicate by Nick, RiggsFolly
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.
add a comment |
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
php mysql
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
php mysql
asked Nov 12 at 1:57
Wesley Schravendijk
369
369
marked as duplicate by Nick, RiggsFolly
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
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.
add a comment |
add a comment |
1 Answer
1
active
oldest
votes
mysqli_error($db->con)
The con
is a mysqli object and that is what the method expects at the parameter
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 ofmysqli_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
add a comment |
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
mysqli_error($db->con)
The con
is a mysqli object and that is what the method expects at the parameter
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 ofmysqli_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
add a comment |
mysqli_error($db->con)
The con
is a mysqli object and that is what the method expects at the parameter
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 ofmysqli_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
add a comment |
mysqli_error($db->con)
The con
is a mysqli object and that is what the method expects at the parameter
mysqli_error($db->con)
The con
is a mysqli object and that is what the method expects at the parameter
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 ofmysqli_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
add a comment |
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 ofmysqli_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
add a comment |