Hey i am trying to understand what the problem with the following code
I get the following error: Parse error: syntax error, unexpected T_STRING on line 2
[code]<?php parseString($searchterm); if (strlen($searchterm_clean) > 0) { $searchterm = $searchterm_clean;} $keywords = explode(" ", $searchterm); $sql = “SELECT DISTINCT *, date_format(date, ‘%a %c/%e/%Y’) as date_reformated FROM $table_sermons
“; if ($_GET[‘q’]) { $sql .=” WHERE”; $i = 1; foreach ($keywords as $keyword) { if (count($keywords) == $i) { // If this is the last keyword $sql .= “(title
LIKE ‘%$keyword%’ OR speaker
LIKE ‘%$keyword%’ OR series
LIKE ‘%$keyword%’ OR scripture
LIKE ‘%$keyword%’)”; } else { $sql .= "(title
LIKE ‘%$keyword%’ OR speaker
LIKE ‘%$keyword%’ OR series
LIKE ‘%$keyword%’ OR scripture
LIKE ‘%$keyword%’) AND "; } $i++; }} $counttotal_sql = $sql;$counttotal = mysql_query($counttotal_sql) or die(mysql_error()); // select all records$counttotal = mysql_num_rows($counttotal); // count records$total_pages = ceil($counttotal / $max); // dive the total, by the maximum results to show //$counttotal_sql = $sql . " GROUP BY id “; $sql .= " ORDER BY date
DESC, tod
DESC, sermon_number
DESC, id
DESC LIMIT $cur, $max”; $query = mysql_query($sql) or die(mysql_error()); // select the results if ($counttotal == 0) { echo "
No sermons found.
“;}else { $begin = $cur + 1;$end = $cur + $max;if ($end > $counttotal) { $end = $counttotal;} echo " rn”;echo " rn";echo " “;echo " “;echo " “;echo " “;echo “”;echo " rn”;echo "
rn”; echo " rn”;echo " Showing “;echo $begin . ‘–’ . $end . ’ of ’ . $counttotal;echo “.rn”;echo " rn”;echo "
rn”;echo " rn";echo " rn"; while($sermon = mysql_fetch_array($query)) { extract($sermon); $number = $number + 1; //result number $remainder = $number % 2; //gives either a 1 or a 0 if ($remainder == ‘1’) { echo " rn"; } else { echo "
rn"; } echo " rn"; echo “$sermon[title]”; echo “<” . “br>rn”; echo “$sermon[speaker]”; if (!empty($sermon[‘series’])) { echo " • $sermon[series]"; } echo “<” . “br>rn”; echo scripture_link($sermon[‘scripture’]); echo " rn"; echo " rn"; echo "$sermon[date_reformated] “; echo strtoupper($sermon[‘tod’]); echo “”; echo “<” . “br>rn”; echo “MP3 (Downloaded $sermon[downloads] “; if ($sermon[‘downloads’] !=1) { $return = ‘times’; } else { $return = ‘time’; } echo “$return) rn”; echo "
rn”;} echo " nn”; if ($total_pages > 1) { echo " nn”; if ($page > 1){ // is the page number more than 1? $prev = ($page - 1); // if so, do the following. take 1 away from the current page number echo “”; echo "« Previous "; // echo a previous page link } for ($i = 1; $i <= $total_pages; $i++) { // for each page number if ($page == $i) { // if this page were about to echo = the current page echo "$i "; // echo the page number bold } else { echo "$i "; // echo a link to the page } } if ($page < $total_pages){ // is there a next page? $next = ($page+ 1); // if so, add 1 to the current echo “Next »”; // echo the next page link }}}?>
[/code]