2000-06-16 05:25:45 +00:00
|
|
|
<?php
|
2000-06-16 05:24:11 +00:00
|
|
|
need ('date sql');
|
|
|
|
|
2000-06-16 05:36:34 +00:00
|
|
|
$searchString = "'%$string%'";
|
2000-06-16 05:24:11 +00:00
|
|
|
$conn = @mysql_pconnect (sqlHost, sqlUser, sqlPass);
|
|
|
|
if ($conn) {
|
|
|
|
$query = 'SELECT n_date, n_user, n_news FROM news_main WHERE '.
|
|
|
|
'n_news LIKE ' . $searchString . ' ORDER BY n_date DESC';
|
|
|
|
$result = @mysql_db_query (sqlDB, $query, $conn);
|
2000-06-16 05:34:41 +00:00
|
|
|
echo $query;
|
2000-06-16 05:24:11 +00:00
|
|
|
if ($result) {
|
|
|
|
$numRows = @mysql_num_rows ($result);
|
|
|
|
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++) {
|
|
|
|
list ($n_date, $n_user, $n_news) = mysql_fetch_row ($result);
|
|
|
|
newsItem (dateFromSQLDateTime ($n_date), $n_user, StripSlashes($n_news));
|
|
|
|
}
|
|
|
|
tableBoxFooter();
|
|
|
|
echo '</TD></TR></TABLE>';
|
|
|
|
} else {
|
2000-06-16 05:34:41 +00:00
|
|
|
echo '<P>No news found matching "' . $string . '"';
|
2000-06-16 05:24:11 +00:00
|
|
|
}
|
|
|
|
} else {
|
|
|
|
echo '<P>No news found matching "' . $string . '"\n';
|
|
|
|
}
|
|
|
|
mysql_close ($conn);
|
|
|
|
} else {
|
|
|
|
echo '<P>SQL error, please contact the webmaster.';
|
|
|
|
}
|
2000-06-16 05:25:45 +00:00
|
|
|
?>
|