Jump to content

php tables error


marquis

Recommended Posts

from what i can tell i follows your tutorial exactly i copied and pasted your code and then modified it for my purposedhere it is<?php$con = mysql_connect("localhost","root","******");if (!$con) { die('Could not connect: ' . mysql_error()); }mysql_select_db("realestate", $con);$result = mysql_query("SELECT * FROM estateWHERE type='retail'");while($row = mysql_fetch_array($result)) { echo "<table border='1'> <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['Squareft'] . "</td>"; echo "<td>" . $row['County'] . "</td>"; echo "<td>" . $row['YearBuilt'] . "</td>"; echo "<td>" . $row['BuyorLease'] . "</td>"; echo "</tr>"; echo "</table>"; }mysql_close($con);?>i get this when entered Address Price Baths Bedrooms State City Square Feet County Year Built Buy or Lease "; echo ""; echo "" . $row['Address'] . ""; echo "" . $row['Price'] . ""; echo "" . $row['Baths'] . ""; echo "" . $row['Bedrooms'] . ""; echo "" . $row['State'] . ""; echo "" . $row['City'] . ""; echo "" . $row['Squareft'] . ""; echo "" . $row['County'] . ""; echo "" . $row['YearBuilt'] . ""; echo "" . $row['BuyorLease'] . ""; echo ""; echo ""; } mysql_close($con); ?>any idea of why this is??

Link to comment
Share on other sites

The file needs to be viewed through a Browser and there needs to be a php parser to handle the php requests. If you have a version of php installed on your machine, make sure it is running and have the browser set up to parse the page as a php page, not an html page.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...