php - mysql_query(...) returns boolean value


My PHP snippet does not work,var_dump(..) saysbool(false) but the db is filled with 1 record. What am I doing wrong?

$sessionResultSet = mysql_query('select * from sessions');



mysql_queryreturn false if you have an error in your SQL query.

echo mysql_error();

should fix that problem.

People are also looking for solutions to the problem: Want to learn how to use php to save data in forms. How come this doesn't work in a html file?


Didn't find the answer?

Our community is visited by hundreds of web development professionals every day. Ask your question and get a quick answer for free.

Ask a Question

Write quick answer

Do you know the answer to this question? Write a quick response to it. With your help, we will make our community stronger.

Similar questions

Find the answer in similar questions on our website.