I understand -- we all, at one time or another, had to begin somewhere.
Without knowing exactly which line 27 is, I'm going to guess it's your sequence of elseif statements. They do not need to be capitalized (this isn't your problem though), but you have the syntax wrong. Those are functions, not statements, therefore you need {'s instead of ;'s. Also, you didn't concatenate your code in the last while loop and it was missing an extra ) at the end:
Code:
<?php
echo ("<P>" . $row ["lieu, description, prix, photo"] . "</P>");
Anyway, try this code:
PHP Code:
<?php
$dbcnx = @mysql_connect("localhost","root","");
if (!dbcnx) {
echo("<P> La connection avec la base de données est impossible pour l'instant.</P>");
exit ();
}
if (!@mysql_select_db ("jeanine"))
{
echo("<P<Selection du table impossible.</P>");
exit ();
}
if ($Lieu == "1" )
{
$result = mysql_query ("SELECT lieu, description, prix, photo FROM Jeanine ORDER BY prix");
}
elseif ($Lieu == "2")
{
$result = mysql_query ("SELECT lieu, description, prix, photo FROM Jeanine ORDER BY prix WHERE lieu = 'Castillonès'");
}
elseif ($Lieu == "3")
{
$result = mysql_query ("SELECT lieu, description, prix, photo FROM Jeanine ORDER BY prix WHERE lieu = 'Monpazier'");
}
elseif ($Lieu == "4")
{
$result = mysql_query ("SELECT lieu, description, prix, photo FROM Jeanine ORDER BY prix WHERE lieu = 'Villeréal'");
}
while ($row = mysql_fetch_array ($result))
{
echo ("<P>" . $row ["lieu, description, prix, photo"] . "</P>");
}
?>
Bookmarks