alienmojo Posted February 1, 2007 Share Posted February 1, 2007 echo '<a href="property.html?accountnum='.$accountnum.'">Click here add house to your favorites</a>'; not sure what i did wrong here is the error Parse error: parse error, unexpected T_ECHO in C:\Documents and Settings\marquis taliaferro\Desktop\web page\descrip.php on line 81 Link to comment https://forums.phpfreaks.com/topic/36599-snytax/ Share on other sites More sharing options...
Jessica Posted February 1, 2007 Share Posted February 1, 2007 You need to post some more of the code before it, and put the code tags around it. Link to comment https://forums.phpfreaks.com/topic/36599-snytax/#findComment-174335 Share on other sites More sharing options...
alienmojo Posted February 1, 2007 Author Share Posted February 1, 2007 <html> <head> <title>Description</title> <link rel="stylesheet" href="CSS.css" type="text/css" /> </head> <body> <div id="sidebar"> <img src="images/bigdoglogo.gif" width="225"height="79" border="0"><div id="menu"> <a href="Home.html">Home</a> <a href="AboutUs.html">About Us</a> <a href="CMS.php">Realtor login</a> </div> </div> <div id="content"> <h1>Description</h1> <br> <br> <?php $accountnum=$_GET["accountnum"]; $con = mysql_connect("localhost","root","******"); if (!$con) { die('Could not connect: ' . mysql_error()); } mysql_select_db("realestate", $con); $result = mysql_query("SELECT * FROM estate WHERE accountnum='$accountnum'"); while($row = mysql_fetch_array($result)) { $accountnum=$row['accountnum']; echo '<center>'; echo '<img src="images/'. $row['imagename'] .'" width="400"height="400">'; echo '</center>'; echo '<br>'; echo '<br>'; echo "<table border='5'bgcolor='#ff8080'> <tr> <th>Address</th> <th>Price</th> <th>Baths</th> <th>Bedrooms</th> <th>State</th> <th>City</th> <th>Square Feet</th> <th>County</th> <th>Year Built</th> <th>Buy or Lease</th> </tr>"; echo "<tr>"; echo "<td>" . $row['address'] . "</td>"; echo "<td>" . $row['price'] . "</td>"; echo "<td>" . $row['baths'] . "</td>"; echo "<td>" . $row['bedrooms'] . "</td>"; echo "<td>" . $row['state'] . "</td>"; echo "<td>" . $row['city'] . "</td>"; echo "<td>" . $row['squarefeet'] . "</td>"; echo "<td>" . $row['county'] . "</td>"; echo "<td>" . $row['yearbuilt'] . "</td>"; echo "<td>" . $row['buyorlease'] . "</td>"; echo "</tr>"; echo "</table>"; echo "<br>"; echo "<br>"; echo "<center>"; echo "<h4>"; echo $row['description']; echo "<h4/>"; echo "<center/>"; } mysql_close($con); $accountnum=$_GET[accountnum] echo '<a href="property.html?accountnum='.$accountnum.'">Click here add house to your favorites</a>'; ?> </body> </html> Link to comment https://forums.phpfreaks.com/topic/36599-snytax/#findComment-174337 Share on other sites More sharing options...
Jessica Posted February 1, 2007 Share Posted February 1, 2007 The line above it is missing the ; on the end. Link to comment https://forums.phpfreaks.com/topic/36599-snytax/#findComment-174338 Share on other sites More sharing options...
JasonLewis Posted February 1, 2007 Share Posted February 1, 2007 and when using global arrays like $_GET please put the ' and ' around the array value. like this: $accountnum = $_GET['accountnum']; Link to comment https://forums.phpfreaks.com/topic/36599-snytax/#findComment-174390 Share on other sites More sharing options...
trq Posted February 1, 2007 Share Posted February 1, 2007 and when using global arrays like $_GET please put the ' and ' around the array value. This has nothing to do with global arrays in particular, but should be done when using any array containing non numeric keys. Link to comment https://forums.phpfreaks.com/topic/36599-snytax/#findComment-174400 Share on other sites More sharing options...
JasonLewis Posted February 1, 2007 Share Posted February 1, 2007 and when using global arrays like $_GET please put the ' and ' around the array value. This has nothing to do with global arrays in particular, but should be done when using any array containing non numeric keys. true. i dont think i was ment to write global, but its all good. good correction. Link to comment https://forums.phpfreaks.com/topic/36599-snytax/#findComment-174402 Share on other sites More sharing options...
bibby Posted February 1, 2007 Share Posted February 1, 2007 right, even though $array[index] still works, PHP tries to parse it as a constant first, so it's a resource burn. Link to comment https://forums.phpfreaks.com/topic/36599-snytax/#findComment-174423 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.