Jump to content

Need help with fulltext search


idos

Recommended Posts

I'm creating a fulltext search where i want to search a set of columns of sertain keywords.
So far ...i 'm stuck with the search query (Parse error: parse error, unexpected ';' in)

[code]<?php
// if search form has been submitted
if (isset($_POST['submit']))
{
$key = $_POST['key'];
echo "$key";

if (!$con)
  {
  die('Could not connect: ' . mysql_error());
  }

mysql_select_db("rekvisita", $con);

$result = mysql_query($sql = "SELECT * FROM `rek` WHERE MATCH (fag,kategori,navn,beskrivelse,forsok) AGAINST ('$key');";

echo "<table border='1' cellspacing='0' cellpadding='2' bgcolor='#ffff99'>
<tr>
<th>Fag</th>
<th>Kategori</th>
<th>Navn</th>
<th>Beskrivelse</th>
<th>Plassering</th>
<th>Dato</th>
</tr>";

while($row = mysql_fetch_array($result))


  {
  echo "<tr>";
  echo "<td>" .  $row['fag'] . "</td>";
  echo "<td>" .  $row['kategori'] . "</td>";
  echo "<td>" .  $row['navn'] . "</td>";
  echo "<td>" .  $row['beskrivelse'] . "</td>";
  echo "<td>" .  $row['plassering'] . "</td>";
  echo "<td>" .  $row['dato'] . "</td>";
  echo "</tr>";
  }
echo "</table>";

}


else
{
echo "Legg inn filter eller søk";
}
?>[/code]

Help .. .. i'm lost here
Link to comment
https://forums.phpfreaks.com/topic/31031-need-help-with-fulltext-search/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.