I 'm developing a search tool for finding content in database. All the other queries execute without problems and i get the results. Here is the code returns error:
$sql = "select id from jos_content where fulltext like '%".$SearchWords[$i]."%' ";
$result = mysql_query($sql, $dbcon) or die(mysql_error());
while ($row = mysql_fetch_array($result))
{
$FoundInFullText[] = $row["id"];
}
Here you can see the error i get:
You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'fulltext like '%query%'' at line 1.
I have 2 scripts similar to this. The only difference between is the table name.
The code below is executed fine:
$sql = "select id from jos_content where introtext like '%".$SearchWords[$i]."%' ";
$result = mysql_query($sql, $dbcon) or die(mysql_error());
while ($row = mysql_fetch_array($result))
{
$FoundInIntroText[] = $row["id"];
}
I tried to change the table name "introtext" of the second sript that has no problem to "fulltext", this is the table name of the problem script, and then the error was hapening again and when i changed the name back to "introtext" it was OK.
I anybody could help i would be gratefull