Hi,
I'm trying to display results from a MySQL database based on the value of two select lists.
Here's the html I'm using for the form outside the PHP.
<form id="form1" name="form1" method="post" action="<? $PHP_SELF?>">
<label>Duration
<select name="holtype" id="holtype">
<option value="Week" selected="selected">Week</option>
<option value="Midweek">Midweek</option>
<option value="Weekend">Weekend</option>
</select>
</label>
<label>Month
<select name="holperiod" id="holperiod">
<option value="March">March</option>
<option value="April">April</option>
<option value="May">May</option>
<option value="June">June</option>
<option value="July">July</option>
<option value="August">August</option>
<option value="September">September</option>
<option value="October">October</option>
<option value="November">November</option>
</select>
</label>
</form>
And here is my PHP code
<?php
$conn=mysql_connect("localhost","root","");
$table=mysql_select_db("prices,$conn");
$sql="select * from prices where break_type='$holtype' and break_period='$holperiod'";
$rs=mysql_query($sql);
echo("<table width=\"440\" border=\"0\">");
echo("<tr>");
echo("<td width=\"81\"><div align=\"center\">Date</div></td>");
echo("<td width=\"71\"><div align=\"center\">Month</div></td>");
echo("<td width=\"75\"><div align=\"center\">Price</div></td>");
echo("<td width=\"109\"><div align=\"center\">More</div></td>");
echo("</tr>");
while ($row=mysql_fetch_array($rs))
{
echo("<tr>");
echo("<td><div align=\"center\">echo(\"$row['break_date']\");</div></td>");
echo("<td><div align=\"center\">echo(\"$row['break_period']\");</div></td>");
echo("<td><div align=\"center\">echo(\"$row['break_price']\")</div></td>");
}
echo("<td><div align=\"center\"></div></td>");
echo("</tr>");
echo("</table>");
?>
However when I go to run I get the following error
Parse error: parse error, unexpected T_ENCAPSED_AND_WHITESPACE, expecting T_STRING or T_VARIABLE or T_NUM_STRING in C:\wamp\www\Caravan\prices.php on line 114
Can anyone suggest where I'm going wrong/
Thanks,
Andrew