Mailinglisten-Archive |
hi....
>Vielleicht tuts ja sowas ... weiß immernoch nicht ob ich dich richtig
>verstanden habe und ob das da unten auch funzt ;).
hmmm das mus ich mal testen ... hier ist meine lösung :-)
nen bissel komplizierter ....aber geht auch ...
<?
$strTab = "Titel Kata Zutaten";
$saTab = explode (" ",$strTab);
$TabSize = count($saTab);
$strSuche = "a +b +c";
$saSuche = explode ("+",$strSuche); // Erstellt ein array aller begriffe
$intArraySize = count($saSuche); // Größe des Arrays
$i = 0;
$j = 0;
while ($i < $TabSize ) {
$Tab = $saTab[$i];
$tab_array[] = "like '%".trim($satab[$i])."%'";
$qstring .= "(";
while ($j < $intArraySize ) {
$bla = $saSuche[$j];
$qstring = $qstring . "($Tab like '".trim($saSuche[$j])."')";
//$like_array[] = "($Tab like '".trim($saSuche[$j])."')";
$j++;
if ($j < $intArraySize){
$qstring = $qstring . " && ";
}
}
$j = 0;
$i++;
if ($i < $TabSize){
$qstring = $qstring . ") || ";
}
}
$SQLfinalstring = $qstring . ")";
print "<BR>$qstringfinal<BR>";
print "<BR><BR>";
$SQLbase = "SELECT * FROM $usertable WHERE ";
$SQLtail = "order by Titel LIMIT $offset,$maxrows'";
$query = $SQLbase . $SQLfinalstring . $SQLtail;
$query1 = $SQLbase . $SQLfinalstring;
print "FINAL !!! $query <BR>";
print "FINAL !!! $query1 <BR>";
?>
gruss alex.....
php::bar PHP Wiki - Listenarchive