Mailinglisten-Archive |
Lutz wrote: > fuer soetwas verwende ich gerne expr IN (value,...), d.h. hier z.B. > select * from tabelle where id IN (0, 1, ...); > -> http://dev.mysql.com/doc/mysql/en/Comparison_Operators.html#IDX1233 Jeppa! Etwa: $html = '<!--category:0--> <!--category:1--> <!--category:6-->'; preg_match_all('|<!--category:([0-9]+)-->|i', $html, $matches); $IDs = $matches[1]; $IDstring = implode(',', $IDs); $sql = 'SELECT * ROM tabelle WHERE id IN ('.$IDstring.')'; Gruss, Andreas http://www.andreas-demmer.de
php::bar PHP Wiki - Listenarchive