[SQL]Fatal error in the query
Solved
-
Hello,
I must have an error (more or less significant) in my query, but as strange as it may seem, I can't find it...
I hope you can see it better than I can
Here is my problematic query:
Thank you in advance for your answers and thank you for reading!
Have a good day,
hharchi9.
Configuration: Windows 7 / Chrome 38.0.2125.104
I must have an error (more or less significant) in my query, but as strange as it may seem, I can't find it...
I hope you can see it better than I can
Here is my problematic query:
$reponse= $bdd->query( 'SELECT Titre,affiche,lien,Genre FROM FROM films WHERE coupdecoeur=1 UNION SELECT Titre,affiche,lien,Genre FROM sagas WHERE coupdecoeur=1 ORDER BY Titre'); while ($donnees = $reponse->fetch()) { ... Thank you in advance for your answers and thank you for reading!
Have a good day,
hharchi9.
Configuration: Windows 7 / Chrome 38.0.2125.104
1 answer
-
Hello,
You have two FROM in the first query.-
-
-
-
It's strange, I created both tables with one record in each and it's working for me.
I used this code:
$response= $bdd->query( 'SELECT Titre,affiche,lien,Genre FROM films WHERE coupdecoeur=1 UNION SELECT Titre,affiche,lien,Genre FROM sagas WHERE coupdecoeur=1 ORDER BY Titre'); while ($data = $response->fetch()) { echo $data["Titre"] . " " . $data["affiche"] . " " . $data["lien"] . " " . $data["Genre"]; } ?> -
-