My browser keeps saying I have a parse error on line 79 of the code below. Does anyone see something wrong with this code? Line 79 is marked with a comment.
<?
// search.php
require("globals.php") ;
require("common.php") ;
// Check if at least one search criteria is entered
if (!$case_number && !$complaint_category && !$task_number && !$task_compl_category
&& !$business_impact && !$user_priority && !$problem_description && !$company_name
&& !$contact_name && !$contact_phone && !$initiator_name && !$initiator_email
&& !$area && !$comments && !$date_submitted) {
DisplayErrMsg(" Error: At least one search criteria should be present\n") ;
exit() ;
}
// Generate the SQL command for doing a select from the Database
$searchStmt = "SELECT * from $tableName where " ;
if ($case_number)
$searchStmt .= "case_number like '%$case_number%' and " ;
if ($complaint_category)
$searchStmt .= "complaint_category like '%$complaint_category%' and " ;
if ($task_number)
$searchStmt .= "task_number like '%$task_number%' and " ;
if ($task_compl_category)
$searchStmt .= "task_compl_category like '%$task_compl_category%' and " ;
if ($business_impact)
$searchStmt .= "business_impact '$business_impact' and " ;
if ($user_priority)
$searchStmt .= "user_priority '$user_priority' and " ;
if ($problem_description)
$searchStmt .= "problem_description '$problem_description' and " ;
if ($company_name)
$searchStmt .= "company_name '$company_name' and " ;
if ($contact_name)
$searchStmt .= "contact_name '$contact_name' and " ;
if ($contact_phone)
$searchStmt .= "contact_phone '$contact_phone' and " ;
if ($initiator_name)
$searchStmt .= "initiator_name '$initiator_name' and " ;
if ($initiator_email)
$searchStmt .= "initiator_email '$initiator_email' and " ;
if ($area)
$searchStmt .= "area '$area' and " ;
if ($comments)
$searchStmt .= "comments '$comments' and " ;
if ($date_submitted)
$searchStmt .= "date_submitted '$date_submitted' and " ;
$stmt= substr($searchStmt, 0, strlen($searchStmt)-4) ;
// Connect to the Database
if (!($link=mysql_pconnect($hostName, $userName, $password))) {
DisplayErrMsg(sprintf("error connecting to host %s, by user %s",
$hostName, $userName)) ;
exit() ;
}
// Select the Database
if (!mysql_select_db($databaseName, $link)) {
DisplayErrMsg(sprintf("Error in selecting %s database", $databaseName)) ;
DisplayErrMsg(sprintf("error:%d %s", mysql_errno($link), mysql_error($link))) ;
exit() ;
}
// Execute the Statement
if (!($result =mysql_query($stmt, $link))) {
DisplayErrMsg(sprintf("Error in executing %s stmt", $stmt)) ;
DisplayErrMsg(sprintf("error:%d %s", mysql_errno($link), mysql_error($link))) ;
exit() ;
}
// Display the results of the search
printf("<TABLE BORDER WIDTH=\"200%%\" BGCOLOR=\"#FFFFFF\" NOSAVE>\n");
printf("<TR>
<td><b>Case #</b></td> // line 79
<td><b>Complaint Category</b></td>
<td><b>Task #</b></td>
<td><b>Task Complaint Category</b></td>
<td><b>Business Impact</b></td>
<td><b>User Priority</b></td>
<td><b>Description</b></td>
<td><b>Company</b></font></td>
<td><b>Contact</b></td>
<td><b>Phone</b></td>
<td><b>Name</b></td>
<td><b>Email</b></td>
<td><b>Area</b></td>
<td><b>Comments</b></td>
<td><b>Date Submitted</b></td>
<TD><B>MODIFY/DELETE</B></TD>
</TR>\n");
while (($row = mysql_fetch_object($result))){
printf("<TR>
<TD>%s</TD>
<TD>%s</TD>
<TD>%s</TD>
<TD>%s</TD>
<TD>%s</TD>
<TD>%s</TD>
<TD>%s</TD>
<TD>%s</TD>
<TD>%s</TD>
<TD>%s</TD>
<TD>%s</TD>
<TD>%s</TD>
<TD>%s</TD>
<TD>%s</TD>
<TD>%s</TD>
<TD><A HREF=\"modify.php?rowid=%s\"><I>Modify</I></A>/
<A HREF=\"delete.php?rowid=%s\"><I>Delete</I></A></TD>
</TR>\n",
$row->case_number, $row->complaint_category, $row->task_number, $row->task_compl_category,
$row->business_impact, $row->user_priority, $row->problem_description, $row->company_name,
$row->contact_name, $row->contact_phone, $row->initiator_name, $row->initiator_email,
$row->area, $row->comments, $row->date_submitted, $row->rowid, $row->rowid) ;
}
printf("</TABLE>\n");
mysql_free_result($result) ;
ReturnToMain() ;
?>