0) { $myecho = eregi_replace ($key_desc, "".$key_desc."", $myecho ); } } //echo $myecho; echo $rowptr[6]; ?>
0) { if (eregi ($key_desc, $myecho)) { $need_print = 1; } $myecho = eregi_replace ($key_desc, "".strtoupper(substr($key_desc,0,1)).substr($key_desc,1)."", $myecho ); } } if ($need_print) { echo $myecho; } } ?> 0) { $myecho = eregi_replace ($key_desc, "".$key_desc."", $myecho ); } } echo $myecho; ?>
'; echo $rowptr[5]; ?>
Fifth Dimension    Site Map    Search    Contact Us
Cancer Supportive and Survivorship Care Website Improving Quality of Life Logo

   Cancer Supportive Survivorship Care Website Search
Alexandra Andrews, Alexei Kireev, MS, Ernest H. Rosenbaum, MD



Advanced Search
SiteMap

0) { //making request pattern $formterm = mysql_real_escape_string($formterm); $key_form_words = split(' ', $formterm); $desc_pattern="1 "; //making begin false statement foreach ( $key_form_words as $key_desc ){ if (strlen($key_desc) > 0) { $desc_pattern = $desc_pattern ."AND description LIKE '%$key_desc%' "; } } $title_pattern="1 "; //making begin false statement foreach ( $key_form_words as $key_title ){ if (strlen($key_title) > 0) { $title_pattern = $title_pattern ."AND title LIKE '%$key_title%' "; } } $author_pattern="0 "; //making begin false statement foreach ( $key_form_words as $key_author ){ if (strlen($key_author) > 0) { $IDresult = mysql_db_query("cscpsearch","SELECT ID FROM author WHERE lastname LIKE '%$key_author%' OR firstname LIKE '%$key_author%'"); while ($ID = mysql_fetch_row($IDresult)) { $authresult = mysql_db_query("cscpsearch","SELECT ID FROM multiauthor WHERE authorID = '$ID[0]';"); $cnt=mysql_num_rows($authresult); if ($cnt > 0) { while ($row = mysql_fetch_row($authresult)) { $author_pattern = $author_pattern ."OR multiauthorID = '$row[0]' "; } } } } } //echo "You are searching for $formterm in the author and description and title fields.

"; //echo "Descpattern $desc_pattern

"; //echo "Titlepattern $title_pattern

"; //echo "Authorattern $author_pattern

"; $pageNum = 1; $resultsPerPage = 20; if (isset($_GET['page'])) $pageNum = $_GET['page']; $offset = ($pageNum - 1) * $resultsPerPage; $sql = "SELECT * FROM articles WHERE $desc_pattern union SELECT * FROM articles WHERE $title_pattern union SELECT * FROM articles WHERE $author_pattern ORDER BY modified DESC "; if ($pageNum != 1) $sql .= " LIMIT $offset,$resultsPerPage"; $formresult = mysql_db_query("cscpsearch", $sql); $count=mysql_num_rows($formresult); if (isset($_GET['count'])) $count = $_GET['count']; if ($count == 0) echo "Sorry, $formterm not found.

"; else { $end = $pageNum * $resultsPerPage; $start = $end - $resultsPerPage + 1; if ($end > $count) $end = $count; echo "$count found Entries $start - $end "; pages($count, $pageNum, $resultsPerPage, $terms); while ($resultsPerPage-- && $row = mysql_fetch_row($formresult)){ displayresult_new($row,$key_form_words); } } }; // end outside if function pages($count, $page, $perPage, $terms) { $pages = ceil($count/$perPage); if ($page > 1) echo "Previous "; for ($i=1; $i<=$pages; $i++) { if ($i == $page) echo "$i "; else echo "$i "; } if ($page < $pages) echo "Next "; } ?>


Index CancerSupportiveCare.com  |  SiteIndex CancerSupportiveCare.com  |  Search CancerSupportiveCare  |  Contact Us  |  Books  |  Top
First appeared July 4, 2006; updated November 25, 2010; reviewed June 17, 2011