var dumping mysqli query gives false boolean [duplicate]
up vote
-1
down vote
favorite
This question already has an answer here:
When to use single quotes, double quotes, and back ticks in MySQL
12 answers
How to display errors for my MySQLi query? [duplicate]
3 answers
im trying to output data from my database but my mysqli query gives me an error. This is my code:
<?php
$mysqli = new mysqli('db','root','mysql');
var_dump(mysqli_query($mysqli,"SELECT * FROM 'posts' "));
?>
this is what my browser shows: bool(false) . Idk how can i fix this problem because im sure that the db is connected.
php mysql database mysqli
New contributor
marked as duplicate by Funk Forty Niner
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();
}
);
});
});
2 days ago
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.
|
show 4 more comments
up vote
-1
down vote
favorite
This question already has an answer here:
When to use single quotes, double quotes, and back ticks in MySQL
12 answers
How to display errors for my MySQLi query? [duplicate]
3 answers
im trying to output data from my database but my mysqli query gives me an error. This is my code:
<?php
$mysqli = new mysqli('db','root','mysql');
var_dump(mysqli_query($mysqli,"SELECT * FROM 'posts' "));
?>
this is what my browser shows: bool(false) . Idk how can i fix this problem because im sure that the db is connected.
php mysql database mysqli
New contributor
marked as duplicate by Funk Forty Niner
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();
}
);
});
});
2 days ago
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.
Look at parameter 4 ofnew mysqli('db','root','mysql');
which you dont have OR look atmysqli_select_db()
but parameter 4 is a better solution. Basically you have not told MySQL what database you want to be looking at. Remember MySQL can manage many databases
– RiggsFolly
2 days ago
Also, incorrect Identifier Qualifiers.
– Funk Forty Niner
2 days ago
I've added a dbname but it still isnt working
– senthuu27
2 days ago
^ that was meant for you I think @RiggsFolly
– Funk Forty Niner
2 days ago
Did you also fix the SELECT error?
– RiggsFolly
2 days ago
|
show 4 more comments
up vote
-1
down vote
favorite
up vote
-1
down vote
favorite
This question already has an answer here:
When to use single quotes, double quotes, and back ticks in MySQL
12 answers
How to display errors for my MySQLi query? [duplicate]
3 answers
im trying to output data from my database but my mysqli query gives me an error. This is my code:
<?php
$mysqli = new mysqli('db','root','mysql');
var_dump(mysqli_query($mysqli,"SELECT * FROM 'posts' "));
?>
this is what my browser shows: bool(false) . Idk how can i fix this problem because im sure that the db is connected.
php mysql database mysqli
New contributor
This question already has an answer here:
When to use single quotes, double quotes, and back ticks in MySQL
12 answers
How to display errors for my MySQLi query? [duplicate]
3 answers
im trying to output data from my database but my mysqli query gives me an error. This is my code:
<?php
$mysqli = new mysqli('db','root','mysql');
var_dump(mysqli_query($mysqli,"SELECT * FROM 'posts' "));
?>
this is what my browser shows: bool(false) . Idk how can i fix this problem because im sure that the db is connected.
This question already has an answer here:
When to use single quotes, double quotes, and back ticks in MySQL
12 answers
How to display errors for my MySQLi query? [duplicate]
3 answers
php mysql database mysqli
php mysql database mysqli
New contributor
New contributor
edited 2 days ago
Madhur Bhaiya
15k52136
15k52136
New contributor
asked 2 days ago
senthuu27
1
1
New contributor
New contributor
marked as duplicate by Funk Forty Niner
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();
}
);
});
});
2 days ago
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 Funk Forty Niner
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();
}
);
});
});
2 days ago
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.
Look at parameter 4 ofnew mysqli('db','root','mysql');
which you dont have OR look atmysqli_select_db()
but parameter 4 is a better solution. Basically you have not told MySQL what database you want to be looking at. Remember MySQL can manage many databases
– RiggsFolly
2 days ago
Also, incorrect Identifier Qualifiers.
– Funk Forty Niner
2 days ago
I've added a dbname but it still isnt working
– senthuu27
2 days ago
^ that was meant for you I think @RiggsFolly
– Funk Forty Niner
2 days ago
Did you also fix the SELECT error?
– RiggsFolly
2 days ago
|
show 4 more comments
Look at parameter 4 ofnew mysqli('db','root','mysql');
which you dont have OR look atmysqli_select_db()
but parameter 4 is a better solution. Basically you have not told MySQL what database you want to be looking at. Remember MySQL can manage many databases
– RiggsFolly
2 days ago
Also, incorrect Identifier Qualifiers.
– Funk Forty Niner
2 days ago
I've added a dbname but it still isnt working
– senthuu27
2 days ago
^ that was meant for you I think @RiggsFolly
– Funk Forty Niner
2 days ago
Did you also fix the SELECT error?
– RiggsFolly
2 days ago
Look at parameter 4 of
new mysqli('db','root','mysql');
which you dont have OR look at mysqli_select_db()
but parameter 4 is a better solution. Basically you have not told MySQL what database you want to be looking at. Remember MySQL can manage many databases– RiggsFolly
2 days ago
Look at parameter 4 of
new mysqli('db','root','mysql');
which you dont have OR look at mysqli_select_db()
but parameter 4 is a better solution. Basically you have not told MySQL what database you want to be looking at. Remember MySQL can manage many databases– RiggsFolly
2 days ago
Also, incorrect Identifier Qualifiers.
– Funk Forty Niner
2 days ago
Also, incorrect Identifier Qualifiers.
– Funk Forty Niner
2 days ago
I've added a dbname but it still isnt working
– senthuu27
2 days ago
I've added a dbname but it still isnt working
– senthuu27
2 days ago
^ that was meant for you I think @RiggsFolly
– Funk Forty Niner
2 days ago
^ that was meant for you I think @RiggsFolly
– Funk Forty Niner
2 days ago
Did you also fix the SELECT error?
– RiggsFolly
2 days ago
Did you also fix the SELECT error?
– RiggsFolly
2 days ago
|
show 4 more comments
active
oldest
votes
active
oldest
votes
active
oldest
votes
active
oldest
votes
active
oldest
votes
Look at parameter 4 of
new mysqli('db','root','mysql');
which you dont have OR look atmysqli_select_db()
but parameter 4 is a better solution. Basically you have not told MySQL what database you want to be looking at. Remember MySQL can manage many databases– RiggsFolly
2 days ago
Also, incorrect Identifier Qualifiers.
– Funk Forty Niner
2 days ago
I've added a dbname but it still isnt working
– senthuu27
2 days ago
^ that was meant for you I think @RiggsFolly
– Funk Forty Niner
2 days ago
Did you also fix the SELECT error?
– RiggsFolly
2 days ago