Everytime I load this page, I get a parse error on line 52 -- which is 'print "Could not connect to server";' I'm stumped. Any help would be greatly appreciated. You guys are awesome! Here's the code:
<?php
// Define database connection details
$dbHost = "localhost";
$dbUser = "sadtech";
$dbPass = "Zap2sadTW";
$dbName = "techweb";
// Attempt to connect to MySQL server
$link = @mysql_connect($dbHost, $dbUser, $dbPass);
// If the connection was unsuccessful...
if (!$link) {
// Report error and exit
print "Could not connect to server";
___ exit;
}
// Attempt to select database. If unsuccessfull...
if (!@mysql_select_db($dbName)) {
// Report error and exit
print "Could not select $dbName database";
mysql_close($link);
exit;
}
// Build query to fetch applications from database
$query = "SELECT_PA.ApplicantID, PA.LastModifiedDate, C.CompanyName, C.ApplicantName, C.Email, PTL.PolicyName, PA.Status
FROM_policyapplications as PA
INNER JOIN companies as C
ON C.CompanyID = PA.CompanyID
INNER JOIN policytypelist as PTL
ON PTL.PolicyTypeID = PA.PolicyTypeID
ORDER BY PA.ApplicantID, PA.PolicyTypeID";
// Execute query
$result = @($query);
// If query was okay...
if (!$result) {
// Error executing the query
print "<tr>\n";
print "<td colspan=5 class=small align=center valign=middle><br>Unable to retrieve aplication information.<br></td>\n";
print "</tr>\n";
mysql_close($link);
_exit;
}
if (mysql_num_rows($result) == 0) {
// Tell no applications in progress
print "<tr>\n";
print "<td colspan=5 class=small align=center valign=middle><br>No applications in progress<br></td>\n";
print "</tr>\n";
}
// For each application returned from query...
while($row = mysql_fetch_array($result)) {
// Output table rows
print "<tr>\n";
print "<td class=tiny align=left valign=top><a href=\"output.php?ApplicantID=" . $row['$ApplicantID'] . "\">Display</a></td>";
print "<td class=tiny align=left valign=top>" . $row['$LastModifiedDate'] . "</td>";
print "<td class=tiny align=left valign=top>" . $row['$CompanyName'] . "<br><a href=\"mailto:" . $row['$Email'] . "\">" . $row['$ApplicantName'] . "</a></td>";
print "<td class=tiny align=left valign=top>" . $row['$PolicyName'] . "</td>";
print "<td class=tiny align=left valign=top>" . $row['$Status'] . "</td>\n";
print "</tr>\n";
}
// Close link to MySQL server
mysql_close($link);
?>