Citat:
Originalno napisao webarto
Kôd:
SELECT id FROM objekti WHERE opis LIKE '%apartmaji maja%'
SELECT id FROM objekti WHERE MATCH (opis) AGAINST ('+apartmaji +maja');
Kako si ti upisao taj LIKE? Ne bi trebao da vraća...
Postavi sve SQL upite...
|
www.slovenijaturizem.com/testing.php koriscen je REGEXP
www.slovenijaturizem.com/testing1.php koriscen je LIKE
www.slovenijaturizem.com/testing2.php koriscen je FULL TEXT
PHP kôd:
$br_rez=mysql_num_rows(mysql_query("SELECT * FROM objekti WHERE akt='Y' AND (naslov REGEXP '[[:<:]]apartmaji[[:>:]]' OR opis REGEXP '[[:<:]]apartmaji[[:>:]]' ) AND (naslov REGEXP '[[:<:]]maja[[:>:]]' OR opis REGEXP '[[:<:]]maja[[:>:]]' )"));
$br_rez=mysql_num_rows(mysql_query("SELECT * FROM objekti WHERE akt='Y' AND (naslov LIKE '%apartmaji%' OR opis LIKE '%apartmaji%') AND (naslov LIKE '%maja%' OR opis LIKE '%maja%')"));
$br_rez=mysql_num_rows(mysql_query("SELECT * FROM objekti WHERE MATCH(opis) AGAINST('+apartmaji +maja')"));