rogerzebra
Technical User
Hi again,
I get this uggly error message when I execute a search for a document in the database. Its only when the search result doesn't match any of the stored records, otherwise everything works fine.
"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 ')' at line 1"
I don't have any sql syntax at line 1?? Is there another way to debugging this thing than just using mysql_error?
Here is parts of the code
Have anyone seen this before? I can't get rid of that error message, so if anyone has a solution for this it would make my day
thanks /rz
I get this uggly error message when I execute a search for a document in the database. Its only when the search result doesn't match any of the stored records, otherwise everything works fine.
"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 ')' at line 1"
I don't have any sql syntax at line 1?? Is there another way to debugging this thing than just using mysql_error?
Here is parts of the code
Code:
this is on line 1...<?php
$submit = $_POST["submit"];
$keywords = $_POST["keywords"];
if(isset($submit_x) && isset($keywords))
{
doSearch($keywords);
}
else
{
getKeywords();
}
function getKeywords()
{
?>
....css/html
...more php
...and it's not before here the sql syntax starts
$query = "SELECT articleIds FROM searchwords WHERE word in (" . implode(',', $arrWords) .") ";
$result=mysql_query($query) or die(mysql_error());
if(mysql_numrows($result)>0)
{
while($row=mysql_fetch_array($result,MYSQL_NUM))
{
if(!isset($matchedarticles)) $matchedarticles .= $row[0];
else $matchedarticles .= ",{$row[0]}";
}
Have anyone seen this before? I can't get rid of that error message, so if anyone has a solution for this it would make my day
thanks /rz