Bonjour tout le monde,
j'essaie d'executer une requete 'join' sql dans un fichier php, mais a chaque fois j'ai une erreur,
au niveau de la connexion au serveur il ny'a aucun problème.
mais apres ca marche plus...
Merci de votre aide.
<?php
$con = mysql_connect("localhost");
if (!$con)
{
die('Could not connect: ' . mysql_error());
}
mysql_select_db("test", $con);
$sql = "SELECT a , b FROM table_1 , table_2 , table_3 , table_4"
. "where table_1.x = table_2.y"
. "AND table_1.m = table_3.n"
. "AND table_1.m = table_4.o"
. "AND table_4.l = '3'"
$result = mysql_query($sql) or die(mysql_error());
while($row = mysql_fetch_array($result)){
echo $row['a']. " - ". $row['b'];
echo "<br />";
}
?>