camaross
11-09-2011, 12:34 AM
This is part of a search engine code to render the result to a html page. It works flawlessly, until I add the most outside 'for' loop.
This is the error message Parse error: syntax error, unexpected '}' in /home/search.php on line 100
Line 100 is the last line with "}"
What am I missing here? Thank you in advance.
for ($coun=1000; $coun<1103; $coun ++) {
$nu="A" . $coun;
/* Accessing the rows */
$extract=mysql_query("SELECT * FROM $table WHERE code='$nu' ORDER BY id ASC");
$number=mysql_numrows($extract);
if($number>0):
while($row = mysql_fetch_array($extract)){
$code[] =$row['code'];
$type[] =$row['type'];
$definition[] =$row['definition'];
$make[] =$row['make'];
$english[] =$row['english'];
$description[]=$row['description'];
}
for ($num=0; $num<$number; $num++) {
$theResults .= "
<table style=\"position:relative; width: 600px; left:-10px; border-collapse:collapse;\" >
<tr>
<th style=\"width:60px; padding-left:2px; text-align:center; background-color:#FF9; font-size:14px;font-weight:bold; \">$nu</th>
<td style=\"font-weight:bold; \">$definition[$num]</td>
</tr>
</table>";
}
}
This is the error message Parse error: syntax error, unexpected '}' in /home/search.php on line 100
Line 100 is the last line with "}"
What am I missing here? Thank you in advance.
for ($coun=1000; $coun<1103; $coun ++) {
$nu="A" . $coun;
/* Accessing the rows */
$extract=mysql_query("SELECT * FROM $table WHERE code='$nu' ORDER BY id ASC");
$number=mysql_numrows($extract);
if($number>0):
while($row = mysql_fetch_array($extract)){
$code[] =$row['code'];
$type[] =$row['type'];
$definition[] =$row['definition'];
$make[] =$row['make'];
$english[] =$row['english'];
$description[]=$row['description'];
}
for ($num=0; $num<$number; $num++) {
$theResults .= "
<table style=\"position:relative; width: 600px; left:-10px; border-collapse:collapse;\" >
<tr>
<th style=\"width:60px; padding-left:2px; text-align:center; background-color:#FF9; font-size:14px;font-weight:bold; \">$nu</th>
<td style=\"font-weight:bold; \">$definition[$num]</td>
</tr>
</table>";
}
}