Question, I am getting parse error on line 91. This is the first PHP script I have ever attempted to right (so no wonder). It is pasted below. See anything that is a no go that I figured would be possible?
<?php
#connect to db
$dbcnx = @mysql_connect("localhost", "username", "password");
if (!$dbcnx) {
echo( "<P>Unable to connect to the database server at this time.</P>");
exit();
}
#change subject to wildcard if one of not specified
if ($subject=="") {
$subject = '%';
}
#change search to wildcard if nothing is specified
if ($search=="") {
$search = '%';
}
#select database
if (!@mysql_select_db("Correspondence")) {
echo( "<P>Unable to locate data</P>");
exit();
}
#queries database
$result = mysql_query("SELECT Date, Subject, Author, Title, Document_Number, HREF FROM Correspondence WHERE PID=$plant AND UID=$unit AND CID=$cycle AND Subject=$subject AND Title=$search ORDER by $date");
if (!$result) {
echo ("<P>Error querying data" . mysql_error() . "</P>");
exit();
}
#snags results
while ( $row = mysql_fetch_array($result) ) {
?>
<tr align=left>
<td align="center"><?php echo($row["Date"]); ?></td>
<td align="center"><?php echo($row["Subject"]); ?></td>
<td align="center"><?php echo($row["Author"]); ?></td>
<td align="center"><?php echo($row["Title"]); ?></td>
<td align="center"><?php echo($row["Document_Number"]); ?></td>
<td align="center"><a href="<?php echo($row["HREF"]); ?>">Go</a></td>
</tr>
While I am at it, anyone know much about SSI and a datestamp? I have a javascript at the bottom of my pages that checks their modification date, but with SSI the page is created each time it is displayed. Is there a way I could write something in PHP (that would execute before the SSI) so the date is accurate?
Thanks for the help.