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.










share|improve this question









New contributor




senthuu27 is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.











marked as duplicate by Funk Forty Niner 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();
}
);
});
});
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 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










  • 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















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.










share|improve this question









New contributor




senthuu27 is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.











marked as duplicate by Funk Forty Niner 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();
}
);
});
});
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 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










  • 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













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.










share|improve this question









New contributor




senthuu27 is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.












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






share|improve this question









New contributor




senthuu27 is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.











share|improve this question









New contributor




senthuu27 is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.









share|improve this question




share|improve this question








edited 2 days ago









Madhur Bhaiya

15k52136




15k52136






New contributor




senthuu27 is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.









asked 2 days ago









senthuu27

1




1




New contributor




senthuu27 is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.





New contributor





senthuu27 is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.






senthuu27 is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.




marked as duplicate by Funk Forty Niner 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();
}
);
});
});
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 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();
}
);
});
});
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 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










  • 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












  • 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

















active

oldest

votes






















active

oldest

votes













active

oldest

votes









active

oldest

votes






active

oldest

votes

Popular posts from this blog

mysqli_query(): Empty query in /home/lucindabrummitt/public_html/blog/wp-includes/wp-db.php on line 1924

How to change which sound is reproduced for terminal bell?

Can I use Tabulator js library in my java Spring + Thymeleaf project?