Neue Treads mit bstimmtem Inhalt darstellen

Begonnen von nico, 28. Januar 2010, 09:54:09

Vorheriges Thema - Nächstes Thema

nico

Hallo,
könnte mir bitte jemand bei folgendem Problem behilfliich sein:
Ich möchte die Datei newthreadlist.php so abändern, dass nur die Threads dargestellt werden, die einen bestimmten Begriff in Titel oder Text enthalten. Ã,,hnlich der Suche nach einem bestimmten Begriff.
Hat jemand Zeit, mir dabei zu helfen?
Würe mich freuen, danke!
NIco
Nico

nico

So geht es nicht  :-/
 

\".formatstring($thread[titel]).\"\";
     }
//################ Ende Threads ########################
unset($board);
}
newthreadslist();
?>

 
 
HILFE
Nico

Powie

Die Tabellen haben einen Volltext Index. Schneller ist es den post per match() abzufragen.

nico

Ok, aber daran liegt es nicht. Ich bekomme bei diesem Script folgende Fehlermeldung:
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 \'order by dpfthread.time desc limit ,\' at line 7Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in /....php on line 32
[/quote]
Nico

Powie

Beantwortet sich doch von selber.
... \"limit , \" funktioniert nicht.

nico

OK! So funktioniert\'s:
 

$sqlbefehl =  \"select $tab_thread.* from $tab_thread 
                   left join $tab_post on $tab_post.threadid=$tab_thread.id
                   where $tab_post.post like \'%Nico%\'
                   or $tab_post.titel like \'%Nico%\'
                   group by $tab_thread.id
                   having boardid = $fboard\";
Nico

all your base are belong to us