mirror of
https://git.code.sf.net/p/quake/website
synced 2024-11-10 23:32:38 +00:00
well, I don't know why the SQL server won't work, but I'll fix it up
to at least report errors correctly now.
This commit is contained in:
parent
8f8541f020
commit
c7216d1d8e
1 changed files with 8 additions and 6 deletions
|
@ -25,12 +25,10 @@
|
||||||
$today['year']--;
|
$today['year']--;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function searchNews ($string)
|
function searchNews ($string)
|
||||||
{
|
{
|
||||||
need ('sql');
|
need ('date sql');
|
||||||
echo '<TABLE width="100%" cellSpacing="0" cellPadding="0" border="0"> <TR vAlign="top"> <TD colSpan="2">';
|
|
||||||
tableBoxHeader( 'black', tableHeadColor );
|
|
||||||
tableTitle( "Search Results", 1, tableHeadColor );
|
|
||||||
|
|
||||||
$search = "\'%$string%\'";
|
$search = "\'%$string%\'";
|
||||||
$conn = @mysql_pconnect (sqlHost, sqlUser, sqlPass);
|
$conn = @mysql_pconnect (sqlHost, sqlUser, sqlPass);
|
||||||
|
@ -42,10 +40,16 @@ echo '<TABLE width="100%" cellSpacing="0" cellPadding="0" border="0"> <TR vAlign
|
||||||
if ($result) {
|
if ($result) {
|
||||||
$numRows = @mysql_num_rows ($result);
|
$numRows = @mysql_num_rows ($result);
|
||||||
if ($numRows) {
|
if ($numRows) {
|
||||||
|
echo '<TABLE width="100%" cellSpacing="0" cellPadding="0" border="0">'.
|
||||||
|
' <TR vAlign="top"> <TD colSpan="2">';
|
||||||
|
tableBoxHeader( 'black', tableHeadColor );
|
||||||
|
tableTitle( "Search Results", 1, tableHeadColor );
|
||||||
for ($i = 0 ; $i < $numRows ; $i++) {
|
for ($i = 0 ; $i < $numRows ; $i++) {
|
||||||
list ($n_date, $n_user, $n_news) = mysql_fetch_row ($result);
|
list ($n_date, $n_user, $n_news) = mysql_fetch_row ($result);
|
||||||
newsItem (dateFromSQLDateTime ($n_date), $n_user, StripSlashes($n_news));
|
newsItem (dateFromSQLDateTime ($n_date), $n_user, StripSlashes($n_news));
|
||||||
}
|
}
|
||||||
|
tableBoxFooter();
|
||||||
|
echo '</TD></TR></TABLE>';
|
||||||
} else {
|
} else {
|
||||||
echo '<P>No news found matching "' . $string . '"\n';
|
echo '<P>No news found matching "' . $string . '"\n';
|
||||||
}
|
}
|
||||||
|
@ -56,7 +60,5 @@ echo '<TABLE width="100%" cellSpacing="0" cellPadding="0" border="0"> <TR vAlign
|
||||||
} else {
|
} else {
|
||||||
echo '<P>SQL error, please contact the webmaster.';
|
echo '<P>SQL error, please contact the webmaster.';
|
||||||
}
|
}
|
||||||
tableBoxFooter();
|
|
||||||
echo '</TD></TR></TABLE>';
|
|
||||||
}
|
}
|
||||||
?>
|
?>
|
||||||
|
|
Loading…
Reference in a new issue