AN-net
07-09-2004, 11:53 PM
ok im getting an mysql syntax error as usual when ever i build a search engine:(
heres the error
Invalid SQL: SELECT journal_entries.entrytext,journal_entries.entrytit le,journal_entries.entrydate,journal_entries.entry _totalrating AS totalrating,journal_entries.entry_totalvotes AS totalvotes,journal_entries.entry_id,journal_entrie s.journal_id,journals.journalist,journals.journali st_id,journals.journalname FROM journal_entries LEFT JOIN journals ON (journal_entries.journal_id=journals.journal_id) WHERE journal_entries.entry_active=1,journal_entries.pri vate!=1,journal_entries.entrytext LIKE '%test%'
mysql error: 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 'journal_entries.private!=1,journal_entries.entryt ext LIKE '%tes
my code is:
if($_REQUEST['do']=="searchresults")
{
$getentries= $DB_site->query("SELECT journal_entries.entrytext,journal_entries.entrytit le,
journal_entries.entrydate,journal_entries.entry_to talrating AS totalrating,journal_entries.entry_totalvotes AS totalvotes,
journal_entries.entry_id,journal_entries.journal_i d,journals.journalist,journals.journalist_id,
journals.journalname FROM ".TABLE_PREFIX."journal_entries
LEFT JOIN ".TABLE_PREFIX."journals ON (journal_entries.journal_id=journals.journal_id)
WHERE journal_entries.entry_active='1',journal_entries.p rivate!='1',journal_entries.entrytext LIKE '%".$sk."%'
");
while($entry= $DB_site->fetch_array($getentries))
{
eval('$resultbits .= "' . fetch_template('journal_searchresults') . '";');
}
eval('print_output("' . fetch_template('journal_search') . '");');
}
thanks in advance:)
heres the error
Invalid SQL: SELECT journal_entries.entrytext,journal_entries.entrytit le,journal_entries.entrydate,journal_entries.entry _totalrating AS totalrating,journal_entries.entry_totalvotes AS totalvotes,journal_entries.entry_id,journal_entrie s.journal_id,journals.journalist,journals.journali st_id,journals.journalname FROM journal_entries LEFT JOIN journals ON (journal_entries.journal_id=journals.journal_id) WHERE journal_entries.entry_active=1,journal_entries.pri vate!=1,journal_entries.entrytext LIKE '%test%'
mysql error: 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 'journal_entries.private!=1,journal_entries.entryt ext LIKE '%tes
my code is:
if($_REQUEST['do']=="searchresults")
{
$getentries= $DB_site->query("SELECT journal_entries.entrytext,journal_entries.entrytit le,
journal_entries.entrydate,journal_entries.entry_to talrating AS totalrating,journal_entries.entry_totalvotes AS totalvotes,
journal_entries.entry_id,journal_entries.journal_i d,journals.journalist,journals.journalist_id,
journals.journalname FROM ".TABLE_PREFIX."journal_entries
LEFT JOIN ".TABLE_PREFIX."journals ON (journal_entries.journal_id=journals.journal_id)
WHERE journal_entries.entry_active='1',journal_entries.p rivate!='1',journal_entries.entrytext LIKE '%".$sk."%'
");
while($entry= $DB_site->fetch_array($getentries))
{
eval('$resultbits .= "' . fetch_template('journal_searchresults') . '";');
}
eval('print_output("' . fetch_template('journal_search') . '");');
}
thanks in advance:)