ludo2604 kitsch' me if u can | Code :
- <?php
- ///////////////////////////////////////////////////
- // //
- // search.php //
- // module de recherche //
- // //
- ///////////////////////////////////////////////////
- require ("secret/conf.php3" );
- if ($HTTP_POST_VARS['search']):
- $search = $HTTP_POST_VARS['search'];
- elseif ($HTTP_GET_VARS['search']):
- $search = $HTTP_GET_VARS['search'];
- endif;
- $sql = 'SELECT COUNT(*) AS qte FROM ';
- $sql .= artistes . ' WHERE ';
- $sql .= 'nom LIKE "%' . $search . '%"';
- $p = mysql_query($sql);
- $total1 = mysql_result($p,"0","qte" );
- $query = '
- SELECT DISTINCT id,nom FROM artistes WHERE ';
- $query .= 'nom LIKE "%' . $search . '%" ';
- $query .= 'ORDER BY nom';
- $result = mysql_query($query) or die(mysql_error());
- $sql2 = 'SELECT COUNT(*) AS qte2 FROM ';
- $sql2 .= chansons . ' WHERE ';
- $sql2 .= 'titre LIKE "%' . $search . '%"';
- $p2 = mysql_query($sql2);
- $total2 = mysql_result($p2,"0","qte2" );
- $query2 = '
- SELECT DISTINCT t1.id, t1.nom, t1.infos, t2.titre, t2.id_artistes, t2.id_lyrics
- FROM artistes As t1 LEFT join chansons As t2 On (t1.id = t2.id_artistes) WHERE ';
-
- $query2 .= 'titre LIKE "%' . $search . '%" ';
- $query2 .= 'ORDER BY titre';
- $result2 = mysql_query($query2) or die(mysql_error());
- $total = $total1 + $total2 ;
- ?>
|
---------------
Make Portraits, Not War!
|