Hello:
I was wondering if I could borrow some second pair of eyes. I'm running a script and I'm receiving the following error message:
Parse error: syntax error, unexpected '{' in C:\Inetpub\fullfocus\Informed\view_program.php on line 11
This error message is generated by the second script listed below "view_program.php".
I've looked and looked and I cannot seem to figure out where the unexpected "{" is located. I was hoping someone can help me out.
This first script "programs.php" will give you a listing of all the programs in the table. There's no problems with this script. I'm including it so everyone can follow the flow.
<?php
$page_title = 'View Current Loan Programs';
//include ('header3.html');
echo '<h1 id="mainhead">Current Loan Programs</h1>';
require_once ('mysql_connect.php');
$query = "SELECT id, type from mortgage_type";
$result = @mysql_query($query);
$num = mysql_num_rows($result);
if ($num > 0) {
echo '<table align="center" cellspacing="0" cellpadding="5">
<tr><td align="left"><b>ID</b></td>
<td align="left"><b>Mortgage Type</b><td>
</tr>';
while ($row = mysql_fetch_array($result, MYSQL_ASSOC)) {
echo '<tr>
<td align="left">' . $row['id'] . '</td>
<td align="left"><a href="view_program.php?=' . $row['id'] . '">' . $row['type'] . '</td>
</tr>';
}
echo '</table>';
mysql_free_result($result);
} else {
echo '<p class="error">There are currently no loan programs.</p>';
}
mysql_close();
//include ('footer3.html');
?>
This script "view_program.php" produces the error message. This script is supposed display the rates and prices for the program that was selected from the program.php script. The $id of the program is passed into "view_program.php". But I'm receiving the error message I stated at the top of the post.
<?php
$page_title = 'View the Current Loan Rates';
echo '<span class="bold1">Current Loan Rates</span><hr>';
require_once ('mysql_connect.php');
if ( (isset($_GET['id'])) && (is_numeric($_GET['id'])) {
$id = $_GET['id'];
} else {
echo '<h1>Page Error</h1>
<p>This page has been accessed in error.</p><p><br /><br /></p>';
exit();
}
$query = "SELECT a.id, a.mortgage_type_id, a.type, b.rate, b.price, b.date, b.time
FROM mortgage_type a, rates b
WHERE a.mortgage_type_id=$id";
$result = @mysql_query ($query) or die (mysql_error());
echo '<table align="center" cellspacing="0" cellpadding="5">
<tr>
<td align="left"><b>Edit</b></td>
<td align="left"><b>Delete</b></td>
<td align="left"><b>Program</b></td>
<td align="left"><b>Rate</b></td>
<td align="left"><b>Price</b></td>
<td align="left"><b>Date</b></td>
<td align="left"><b>Time</b></td>
</tr>
';
$bg = '#eeeeee'; // Set the background color.
while ($row = @mysql_fetch_array($result, MYSQL_ASSOC)) {
$bg = ($bg=='#eeeeee' ? '#ffffff' : '#eeeeee');
echo '<tr bgcolor="' . $bg . '">
<td align="left">Edit</td>
<td align="left">Delete</td>
<td align="left">' . $row['type'] . '</td>
<td align="left">' . $row['rate'] . '</td>
<td align="left">' . $row['price'] . '</td>
<td align="left">' . $row['date'] . '</td>
<td align="left">' . $row['time'] . '</td>
</tr>
';
}
echo '</table>';
echo '<p><a href="welcome.php">Return to Load Administration Main Menu</a><br /><br />';
@mysql_free_result ($result); // Free up the resources.
mysql_close(); // Close the database connection.
?>
Thanks for all the help.