07-09-2004, 11:53 PM
|
|
|
|
Join Date: Dec 2003
Location: AnimationTalk.com
Posts: 2,367
Благодарил(а): 0 раз(а)
Поблагодарили:
0 раз(а) в 0 сообщениях
|
|
mysql woes
ok im getting an mysql syntax error as usual when ever i build a search engine
heres the error
Quote:
Originally Posted by mysql
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:
PHP Code:
if($_REQUEST['do']=="searchresults")
{
$getentries= $DB_site->query("SELECT journal_entries.entrytext,journal_entries.entrytitle,
journal_entries.entrydate,journal_entries.entry_totalrating AS totalrating,journal_entries.entry_totalvotes AS totalvotes,
journal_entries.entry_id,journal_entries.journal_id,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.private!='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
|