steviecee
06-27-2005, 11:01 AM
I'm using php to search a mysql db. The code is as follows:
<?php
require_once("C:\Server\Apache2\mysql_connect_york.inc");
$typ=$_POST['type'];
$code=$_POST['pcode'];
$cit=$_POST['city'];
$count=$_POST['county'];
$ncit=$_POST['ncity'];
$query_result=mysql_query( 'select location_id, owner_id, loc_name, type, address_1, address_2, city, county, post_code from location where type = $typ');
while($row=mysql_fetch_array($query_result))
{
echo "<tr>";
echo "<td>.$row['location_id'].</td>"; echo "<td>.$row['owner_id'].</td>";
echo "<td>.$row['loc_name'].</td>";
echo "<td>.$row['type'].</td>";
echo "<td>.$row['address_1'].</td>";
echo "<td>.$row['address_2'].</td>";
echo "<td>.$row['city'].</td>";
echo "<td>.$row['county'].</td>";
echo "<td>.$row['post_code'].</td>";
echo "</tr>";
mysql_free_result ($query_result);
mysql_close();
?>
the code is falling down at the highlighted echo with he error:
Parse error: parse error, expecting `T_STRING' or `T_VARIABLE' or `T_NUM_STRING' in C:\Server\Apache2\local-html\search_york.php on line 230
any ideas on the problem? obviously it some sort of data mismatch , but how can i put it right?
Cheers
Steve
<?php
require_once("C:\Server\Apache2\mysql_connect_york.inc");
$typ=$_POST['type'];
$code=$_POST['pcode'];
$cit=$_POST['city'];
$count=$_POST['county'];
$ncit=$_POST['ncity'];
$query_result=mysql_query( 'select location_id, owner_id, loc_name, type, address_1, address_2, city, county, post_code from location where type = $typ');
while($row=mysql_fetch_array($query_result))
{
echo "<tr>";
echo "<td>.$row['location_id'].</td>"; echo "<td>.$row['owner_id'].</td>";
echo "<td>.$row['loc_name'].</td>";
echo "<td>.$row['type'].</td>";
echo "<td>.$row['address_1'].</td>";
echo "<td>.$row['address_2'].</td>";
echo "<td>.$row['city'].</td>";
echo "<td>.$row['county'].</td>";
echo "<td>.$row['post_code'].</td>";
echo "</tr>";
mysql_free_result ($query_result);
mysql_close();
?>
the code is falling down at the highlighted echo with he error:
Parse error: parse error, expecting `T_STRING' or `T_VARIABLE' or `T_NUM_STRING' in C:\Server\Apache2\local-html\search_york.php on line 230
any ideas on the problem? obviously it some sort of data mismatch , but how can i put it right?
Cheers
Steve