-1

I'm stuck with a boolean = false result. The database query responded that the code was approved, so correct!

None of the form solutions helped me out, so now i hope you can give me a answer. here is my code. thanks for your help for now!

    $query = "SELECT FROM bedrijfsgegevens 
            ORDER BY omschrijvingen.datum";
            $result = $db->query($query);
    while ($row = mysql_fetch_assoc($result)) {
    echo "<tr><td>van <a href='mailto:" . $row["email"] . "'>" . $row["naam"] . "</a></td>
          <td>op " . $row["datum"]  . "</td></tr>\n";
    echo "<tr><td colspan='2'>" . $row["omschrijving"]  . "</td></tr>\n";
    echo "<tr><td colspan='2'> </td></tr>\n";
}
a_horse_with_no_name
  • 497,550
  • 91
  • 775
  • 843

2 Answers2

0

You are mixing up the new mysqli API with the old mysql functions. Choose one. Also make sure you are connected to the database.

If you choose the old API the code would look like this:

$result = mysql_query($query);
while ($row = mysql_fetch_assoc($result)) {
...

Furthermore your query is wrong, you must select some field, example:

SELECT * FROM bedrijfsgegevens ORDER BY omschrijvingen.datumenter

The * will select all fields.

  • Thanks for your answer. i tried the same code before, but without succes what i thing its strange. I was using now the mysql_error() in my echo, and i was getting an "No Database Selected" reply. what i did was changing the SQL code to SELECT * FROM bedrijfsgegevens, omschrijvingen. i removed the sentence omschrijvingen.datum. And now its oke! thanx for your help!! – Frank Manuela Thijssen Sep 29 '16 at 22:15
0

Make it

$query = "SELECT * FROM bedrijfsgegevens 
        ORDER BY omschrijvingen.datum";