From c7216d1d8e03993afbf7135e0252ea9511d74468 Mon Sep 17 00:00:00 2001 From: Dan Olson Date: Tue, 13 Jun 2000 03:21:01 +0000 Subject: [PATCH] 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. --- news_funcs.php | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/news_funcs.php b/news_funcs.php index 3722b21..8f78b98 100644 --- a/news_funcs.php +++ b/news_funcs.php @@ -25,12 +25,10 @@ $today['year']--; } } + function searchNews ($string) { - need ('sql'); -echo '
'; - tableBoxHeader( 'black', tableHeadColor ); - tableTitle( "Search Results", 1, tableHeadColor ); + need ('date sql'); $search = "\'%$string%\'"; $conn = @mysql_pconnect (sqlHost, sqlUser, sqlPass); @@ -42,10 +40,16 @@ echo ''. + '
'; + 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 '
'; } else { echo '

No news found matching "' . $string . '"\n'; } @@ -56,7 +60,5 @@ echo 'SQL error, please contact the webmaster.'; } - tableBoxFooter(); - echo '
'; } ?>