Jump to content

Recommended Posts

Im getting the following error

 

 

Parse error: parse error in C:\xampp\htdocs\Estate.php on line 14

 

line 14 refers to

 

$sql = "Select `Fname`,`Sname`, `Address1`, `Address2`, `Address3`, `Address4` FROM `Athy` WHERE `Address2`='".$Address2."'";

 

My entire code is

 

<?
include("connect.php");
// now you are connected and can query the database

if(!empty($_POST['Address2'])) {
   $Address2 = $_POST['Address2'];
   $Fname=$_POST['Fname'];
   $Sname=$_POST['Sname'];
   $Address1=$_POST['Address1'];
   $Address2=$_POST['Address2'];
   $Address3=$_POST['Address3'];
   $Address4=$_POST['Address4']
   
$sql = "Select `Fname`,`Sname`, `Address1`, `Address2`, `Address3`, `Address4` FROM `Athy` WHERE `Address2`='".$Address2."'";
//echo $sql;
$var = mysql_query($sql) or die(mysql_error());
if(mysql_num_rows($var) > 0) {
   while ($row = mysql_fetch_assoc($var)) {
      echo $row['Fname'].' '.$row['Sname'].' '.$row['Address1'].''.$row['Address2'].''.$row['Address3'].''.$row['Address4']. '<br/>';
   }
   } else {
      echo "Failed";
   }
}
else{
?>
<html>
<style type="text/css">
label {
width:150px;
margin-right:5px;
text-align:right;
display:block;
float:left;
}
.style1 {font-weight: bold}
</style>
<body>
<form name="test.php" method="post" action="<?php echo $_SERVER['PHP_SELF']; ?>">
  <p><img src="untitled.jpg" alt="" width="994" height="176" /></p>
   <p align="left"><label for "Address2"><strong>Address 2</strong></label>
   <select name="Address2">
<option value="Ardreigh, (ED Athy Rural)">Ardreigh, (ED Athy Rural)</option>
<option value="Ardreigh, (Inside U.D.)">Ardreigh, (Inside U.D.)</option>
<option value="Ardrew">Ardrew</option>
<option value="Ardrew Halting Site">Ardrew Halting Site</option>
<option value="Ashville">Ashville</option>
<option value="Athmore Apartments, Church Road">Athmore Apartments, Church Road</option>
<option value="Aughaboura">Aughaboura</option>
<option value="AB8">Avondale Drive</option>
<option value="SVH">Ballybought</option>
<option value="SMN1">Ballynascullogue</option>
<option value="SMN2">Banta Na Bearú</option>
<option value="SMN3">Barkersford</option>
<option value="SNM4">Barrack Lane</option>
<option value="SNM5">Barrow Quay</option>
<option value="AB1">Barrowford</option>
<option value="AB2">Beech Grove</option>
<option value="AB3">Belview</option>
<option value="AB4">Bennettsbridge, (ED Athy Rural)</option>
<option value="AB5">Bennettsbridge, (ED A Rur UD)</option>
<option value="AB6">Blackparks, (ED A Rural UD)</option>
<option value="AB7">Blackparks, (ED Athy W Urb)</option>
<option value="AB8">Bleach (Bungalows)</option>
<option value="SVH">Bleach (Two Storey)</option>
<option value="SMN1">Bothar Bui</option>
<option value="SMN2">Bradburys Flats, Leinster Street</option>
<option value="SMN3">Branswood, (01-50)</option>
<option value="SNM4">Branswood, (051-100)</option>
<option value="SNM5">Branswood, (101-150)</option>
<option value="AB1">Branswood, (151-200)</option>
<option value="AB2">Bray Lower</option>
<option value="AB3">Bray Upper</option>
<option value="AB4">Bridgefield Manor</option>
<option value="AB5">Burrows (The), Coneyburrow</option>
<option value="AB6">Butlers Lane</option>
<option value="AB7">Canal Close</option>
<option value="AB8">Canal Side</option>
<option value="SVH">Canal Walk</option>
<option value="SMN1">Carberry Park</option>
<option value="SMN2">Cardington, (ED A Rural UD)</option>
<option value="SMN3">Cardington, (ED Athy Rural)</option>
<option value="SNM4">Cardington Court</option>
<option value="SNM5">Cardington Demesne, (ED A Rural UD)</option>
<option value="AB1">Cardington Demesne, (ED Athy Rural)</option>
<option value="AB2">Carlow Road</option>
<option value="AB3">Castle Park, (01-50)</option>
<option value="AB4">Castle Park, (51-100)</option>
<option value="AB5">Chanterlands, (Athy Rural)</option>
<option value="AB6">Chanterlands, (Athy East Urb)</option>
<option value="AB7">Chapel Hill</option>
<option value="AB8">Church Crescent</option>
<option value="SVH">Church Road</option>
<option value="SMN1">Clonmullin, (01-50)</option>
<option value="SMN2">Clonmullin, (051-100)</option>
<option value="SMN3">Clonmullin, (101-150)</option>
<option value="SNM4">Clonmullin Retirement Village</option>
<option value="SNM5">Cloverlodge Nursing Home</option>
<option value="AB1">Cluain Bearú</option>
<option value="AB2">Cois Bhearú, Ard Bhearú</option>
<option value="AB3">Cois Bhearú, Bearú Mhór</option>
<option value="AB4">Cois Bhearú, Cluan Bhearú</option>
<option value="AB5">Cois Bhearú, Gleann Bhearú</option>
<option value="AB6">Cois Bhearú, Rathstewart</option>
<option value="AB7">Cois Bhearú, Slí Bhearú</option>
<option value="AB8">Coney Avenue, Coneyburrow</option>
<option value="SVH">Coney Drive, Coneyburrow</option>
<option value="SMN1">Coney Green, Coneyburrow</option>
<option value="SMN2">Coney Meadows, Coneyburrow, (051-100)</option>
<option value="SMN3">Coney Meadows, Coneyburrow, (101-150)</option>
<option value="SNM4">Coney Meadows, Coneyburrow, (001-50)</option>
<option value="SNM5">Coney Park, Coneyburrow</option>
<option value="AB1">Coney Walk, Coneyburrow</option>
<option value="AB2">Coneyburrow</option>
<option value="AB3">Coneyburrow Housing Scheme</option>
<option value="AB4">Convent Gardens, Monasterevin Road</option>
<option value="AB5">Convent Lane</option>
<option value="AB6">Convent View</option>
<option value="AB7">Coolroe</option>
<option value="AB8">Corrán Ard, Kilkenny Road, (01-50)</option>
<option value="SVH">Corrán Ard, Kilkenny Road, (051-100)</option>
<option value="SMN1">Corrán Ard, Kilkenny Road, (101-150)</option>
<option value="SMN2">Courtown East</option>
<option value="SMN3">Courtown West</option>
<option value="SNM4">Cuan Mhuire, Cardington,</option>
<option value="SNM5">Dominican Church Road Apartments</option>
<option value="AB1">Dominican Priory</option>
<option value="AB2">Dublin Road</option>
<option value="AB3">Duke Street</option>
<option value="AB4">Dun Brinn, Ardreigh Field</option>
<option value="AB5">Dun Brinn, Ardreigh Walk</option>
<option value="AB6">Dun Brinn, Ardrew Court</option>
<option value="AB7">Dun Brinn, Ardrew Fields</option>
<option value="AB8">Dun Brinn, Ardrew Heights</option>
<option value="SVH">Dun Brinn, Ardrew Walk</option>
<option value="SMN1">Dun Brinn, Barrow View</option>
<option value="SMN2">Dun Brinn, Barrow Way</option>
<option value="SMN3">Dun Brinn, Bleach Road</option>
<option value="SNM4">Dun Brinn, Bridgeview Gardens</option>
<option value="SNM5">Dun Brinn, Fortbarrington Drive</option>
<option value="AB1">Dun Brinn, River View</option>
<option value="AB2">Dun Brinn, Sunnyside Lawns</option>
<option value="AB3">Dun na Ri, Coneyburrow</option>
<option value="AB4">Earls Court</option>
<option value="AB5">Edmond Rice Square</option>
<option value="AB6">Emily Row</option>
<option value="AB7">Emily Square</option>
<option value="AB8">Fairfield Apartments, Dublin Road</option>
<option value="SVH">Flinters Close</option>
<option value="SMN1">Flinters Place</option>
<option value="SMN2">Forest</option>
<option value="SMN3">Forest Park</option>
<option value="SNM4">Foxhill</option>
<option value="SNM5">Gallow Hill Court, Kildare Road</option>
<option value="AB1">Gallowshill, (ED Athy Rural)</option>
<option value="AB2">Gallowshill, (ED A Rur UD)</option>
<option value="AB3">Geraldine, (ED Athy Rur UD)</option>
<option value="AB4">Geraldine, (ED Athy Rural)</option>
<option value="AB5">Geraldine Road</option>
<option value="AB6">Goulyduff</option>
<option value="AB7">Graysland, (ED Athy E Urb)</option>
<option value="AB8">Graysland, (ED Athy Rur UD)</option>
<option value="SVH">Greenhills</option>
<option value="SMN1">Holmcroft</option>
<option value="SMN2">Janeville Place</option>
<option value="SMN3">Kilcoo</option>
<option value="SNM4">Kildare Road</option>
<option value="SNM5">Kingsgrove</option>
<option value="AB1">Kingsgrove, Graysland</option>
<option value="AB2">Leinster Court</option>
<option value="AB3">Leinster Street</option>
<option value="AB4">Malone Place</option>
<option value="AB5">Mansfield Grove</option>
<option value="AB6">Marina Court, (01-50)</option>
<option value="AB7">Marina Court, (51-100)</option>
<option value="AB8">McAuley Court, St Vincents Hospital</option>
<option value="SVH">McDonnell Drive</option>
<option value="SMN1">Meeting Lane</option>
<option value="SMN2">Michael Dooley Terrace</option>
<option value="SMN3">Milltown</option>
<option value="SNM4">Minch Terrace</option>
<option value="SNM5">Mount Offaly</option>
<option value="AB1">Nelson Street</option>
<option value="AB2">Oaklawn</option>
<option value="AB3">Offaly Street</option>
<option value="AB4">Orchard (The), Dublin Road</option>
<option value="AB5">Orchard (The), Kildare Road</option>
<option value="AB6">Pairc Bhride, (01-50)</option>
<option value="AB7">Pairc Bhride, (51-100)</option>
<option value="AB8">Park Avenue</option>
<option value="SVH">Paudeenourstown, (ED Athy E Urb)</option>
<option value="SMN1">Paudeenourstown, (ED Athy Rur UD)</option>
<option value="SMN2">Plewmans Terrace</option>
<option value="SMN3">Preston Gate</option>
<option value="SNM4">Priory Court</option>
<option value="SNM5">Prussellstown</option>
<option value="AB1">Prussellstown Green, The Way</option>
<option value="AB2">Prussellstown Housing Scheme</option>
<option value="AB3">Quarry</option>
<option value="AB4">Rathstewart</option>
<option value="AB5">Rathstewart Crescent, (051-100)</option>
<option value="AB6">Rathstewart Crescent, (01-50)</option>
<option value="AB7">Rheban Avenue</option>
<option value="AB8">Rheban Castle</option>
<option value="SVH">Rheban Manor, (051-100)</option>
<option value="SMN1">Rheban Manor, (01-50)</option>
<option value="SMN2">Rheban Manor, Cyprian Avenue</option>
<option value="SMN3">Rheban Manor, Hollands (The)</option>
<option value="SNM4">Rheban Manor, Hollands Avenue</option>
<option value="SNM5">Rheban Manor, Hollands Park</option>
<option value="AB1">Rheban Manor, Moneen Drive</option>
<option value="AB2">Rheban Manor, Moneen View</option>
<option value="AB3">Riverdale Apartments</option>
<option value="AB4">Riversdale</option>
<option value="AB5">Rockfield Road</option>
<option value="AB6">Rosbran</option>
<option value="AB7">Roundhills</option>
<option value="AB8">Russellstown</option>
<option value="SVH">Saint Dominics Park</option>
<option value="SMN1">Saint Johns Lane</option>
<option value="SMN2">Saint Johns Manor</option>
<option value="SMN3">Saint Josephs Terrace Lower</option>
<option value="SNM4">Saint Josephs Terrace Upper</option>
<option value="SNM5">Saint Martins Terrace</option>
<option value="AB1">Saint Michaels Court</option>
<option value="AB2">Saint Michaels Terrace</option>
<option value="AB3">Saint Patricks Avenue</option>
<option value="AB4">Saint Vincents Hospital</option>
<option value="AB5">Saint Vincents Hospital Extern</option>
<option value="AB6">Salisbury</option>
<option value="AB7">Sawyerswood</option>
<option value="AB8">Shackleton Court</option>
<option value="SVH">Shamrock Drive</option>
<option value="SMN1">Shamrocklodge</option>
<option value="SMN2">Shanrath</option>
<option value="SMN3">Shanrath East</option>
<option value="SNM4">Shanrath Rise</option>
<option value="SNM5">Shanrath West, (ED Athy Rur UD)</option>
<option value="AB1">Shanrath West, (ED Athy Rural)</option>
<option value="AB2">Shrewleen Lane</option>
<option value="AB3">Srowland</option>
<option value="AB4">Stanhope Place</option>
<option value="AB5">Stanhope Street</option>
<option value="AB6">The Moat, Castlefields</option>
<option value="AB7">Tomard, (ED Athy E Urb)</option>
<option value="AB8">Tomard, (ED Athy Rural)</option>
<option value="SVH">Tomard, (ED Athy Rur UD)</option>
<option value="SMN1">Tonlegee</option>
<option value="SMN2">Tonlegee Court</option>
<option value="SMN3">Tonlegee Downs</option>
<option value="SNM4">Tonlegee Lawns</option>
<option value="SNM5">Townparks, (ED Athy W Urb)</option>
<option value="AB1">Townparks, (ED Athy E Urb)</option>
<option value="AB2">Townparks, (ED Athy Rur UD)</option>
<option value="AB3">Townparks, (ED Athy Rural)</option>
<option value="AB4">Townparks Housing Scheme</option>
<option value="AB5">Tullygorey</option>
<option value="AB6">Whitecastle Lawn, (51-100)</option>
<option value="AB7">Whitecastle Lawn, (01-50)</option>
<option value="AB8">William Street</option>
<option value="SVH">William Street Upper</option>
<option value="SMN1">Willsgrove</option>
<option value="SMN2">Woodstock Close</option>
<option value="SMN3">Woodstock North, (ED Athy Rural)</option>
<option value="SNM4">Woodstock North, (ED Athy Rur UD)</option>
<option value="SNM5">Woodstock South, (ED Athy Rur UD)</option>
<option value="SMN1">Woodstock South, (ED Athy Rural)</option>
<option value="SMN2">Woodstock South, (ED Athy W Urb)</option>
<option value="SMN3">Woodstock Street,</option>
</select>
  </p>
    <p align="left">
    <input name="submit" value="Submit" type="submit" />
  </p>
</form>
</body>
</html>
<?
}
// don't forget to close the mysql connection
mysql_close();
?>

Link to comment
https://forums.phpfreaks.com/topic/149692-solved-sql-parse-error/
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.