1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57
|
$sql=mysql_query("SELECT COUNT(id_forum) as nb_id FROM forum LEFT JOIN titre_sujet ON (id_suj_for=id_forum)
LEFT JOIN post ON (id_titre_sujet=id_post_titre)
WHERE id_forum='".mysql_escape_string($_GET['f2'])."' AND $toug
nom_sujet LIKE '%".ereg_replace("'",' ',$_GET['recherche'])."%'
OR
post_txt
LIKE '%".ereg_replace("'",' ',$_GET['recherche'])."%'
OR nom_forum LIKE '%".ereg_replace("'",' ',$_GET['recherche'])."%' $toud")
or die (mysql_error());
$data=mysql_fetch_assoc($sql);
if(isset($_GET['p'])){
$pagecourante=$_GET['p'];
}
else{
$pagecourante=1;
}
$nb=$data['nb_id'];
$parpage=1;
$nbpage=ceil($nb/$parpage);
$total=$pagecourante*$parpage;
$sql=mysql_query("SELECT nom_forum,id_forum,im_for,id_post_titre,id_post_for,nom_sujet,id_titre_sujet,post_txt
FROM forum
LEFT JOIN titre_sujet ON (id_suj_for=id_forum)
LEFT JOIN post ON (id_titre_sujet=id_post_titre)
WHERE id_forum='".mysql_escape_string($_GET['f2'])."'
AND $toug nom_sujet LIKE '%".ereg_replace("'",' ',$_GET['recherche'])."%' OR
post_txt LIKE '%".ereg_replace("'",' ',$_GET['recherche'])."%' OR
nom_forum LIKE '%".ereg_replace("'",' ',$_GET['recherche'])."%' $toud LIMIT $total , $parpage")or die (mysql_error());
for($i=1;$i<=$nbpage;$i++){
$pagin= "<a href=\"".$_SERVER['PHP_SELF']."?p=$i\">$i<a>/";
} |
Partager