Etre perdu

hoodlum Messages postés 57 Date d'inscription lundi 16 mai 2005 Statut Membre Dernière intervention 24 septembre 2010 - 22 mai 2005 à 02:59
hoodlum Messages postés 57 Date d'inscription lundi 16 mai 2005 Statut Membre Dernière intervention 24 septembre 2010 - 22 mai 2005 à 21:03
contrairement a tous les message ke g pu laissé sur le forum ;G trouvé le probleme .mais je c pa pkoi.
voici mon :
<? include("connect.inc.php");
include("heads.inc.php");


$req= $_SERVER['REQUEST_METHOD'];
if($req=="POST")
$choix=$_POST['choix'];
else{
$choix=$_GET['choix'];
$offset=$_GET['offset'];
$nbmax=$_GET['nbmax'];


}


if($choix==NULL)
{
echo"<center> VOUS AVEZ AUCUN CHOIX </center>";
echo"<hr width =80% align= "middle" />
<center> RETOUR A LA PAGE D'ACCEUIL </center>";
}
else{
if(!isset($offset))$offset =0;
if(!isset($nbmax)) $nbmax= 5;


$query="SELECT id_style FROM style WHERE (style.style)='$choix'";
$resultat=mysql_query($query);
$nbst=mysql_num_rows($resultat);
if($nbst==0)
{
echo"<center> Il n'y a pas encore de script pour la rubrique $choix. </center>";
}
else{
while($tableau =mysql_fetch_array($resultat)){
$id_style=$tableau["id_style"];
$queryst="SELECT no FROM possede WHERE (possede.id_style)='$id_style'";
$resst=mysql_query($queryst);
$nbidx=mysql_num_rows($resst);
$nbp=ceil($nbidx/$nbmax);
//
$queryst="SELECT no FROM possede WHERE (possede.id_style)='$id_style' LIMIT $offset,$nbmax ";
$resst=mysql_query($queryst);
//$nbid=mysql_num_rows($resst);


while($tablea=mysql_fetch_array($resst)){
$no=$tablea["no"];
$queryscr="SELECT id,script FROM script WHERE (script.no)='$no' LIMIT $offset,$nbmax";
$resscr=mysql_query($queryscr);


while($table=mysql_fetch_array($resscr)){
$id=$table["id"];
$script=$table["script"];
$queryren="SELECT rendu FROM rendu WHERE (rendu.id)='$id' LIMIT $offset,$nbmax";
$resren=mysql_query($queryren);
while($tab=mysql_fetch_array($resren)){
$rendu=$tab["rendu"];
echo"<center>RENDU DU SCRIPT:</center>";
echo"<center><script src="$rendu" language="JavaScript" type="text/javascript"></script></center>";
echo"<center>LE SCRIPT CORRESPONDANT A CE RENDU EST:</center>";
echo"<center><textarea name="script" rows=5 cols=40 >$script</textarea></center>";
echo"<center>----------------------------------------------</center>";


}
}
}


}
}


if($offset>0 ){
echo"<center>PRECEDENT ";
}
if(($offset + $nbmax)<=$nbidx){
echo"SUIVANT</center>";
}
echo"<hr width=80% align="middle" />
<center>RETOUR A LA PAGE D'ACCEUIL</center>";
}
include("foot.inc.php");
?>

Le problemes c ke o 2eme passage par pasage a l'url le script arrete d'etre executé a partir de la ou g mis le pointillé car le while n'est pas executé et pourtant il n'affiche aucune errezur!!!

HELP ME PLZ

9 réponses

hoodlum Messages postés 57 Date d'inscription lundi 16 mai 2005 Statut Membre Dernière intervention 24 septembre 2010
22 mai 2005 à 03:02
excusé moi g pa mi les pointillé c peux etre du a la fatigue
enfait ca rentre pa dasn la boucle o nivo de :while($table=mysql_fetch_array($resscr)){

MERCI
0
hoodlum Messages postés 57 Date d'inscription lundi 16 mai 2005 Statut Membre Dernière intervention 24 septembre 2010
22 mai 2005 à 03:04
o nivo de ce while:while($tablea=mysql_fetch_array($resst)){
Excuze bon je vai dormir sinon je m'ecroule
0
hoodlum Messages postés 57 Date d'inscription lundi 16 mai 2005 Statut Membre Dernière intervention 24 septembre 2010
22 mai 2005 à 03:09
dsl ne tener pa compte du message posté a 3h04 car celle d'avant di bien ou on peu plus rentré dans la boucle
Mille excuz!!
aidez moi
0
cs_Anthomicro Messages postés 9433 Date d'inscription mardi 9 octobre 2001 Statut Membre Dernière intervention 13 avril 2007 8
22 mai 2005 à 12:19
Salut,



utilise isset() au lieu de passer par $_SERVER['REQUEST... et par if($machin==NULL)



ensuite condense ton code stp

<hr size="2" width="100%">




<li>Entraide, dépannage et vulgarisation informatique: Mon site de vulgarisation informatique</li>
0

Vous n’avez pas trouvé la réponse que vous recherchez ?

Posez votre question
hoodlum Messages postés 57 Date d'inscription lundi 16 mai 2005 Statut Membre Dernière intervention 24 septembre 2010
22 mai 2005 à 12:39
salut Anthomicro!!


peux tu m'expliké a koi sert isset() et comment l'utilisé dans mon cas stp!!?


je suis un peux un debutant.
0
cs_Anthomicro Messages postés 9433 Date d'inscription mardi 9 octobre 2001 Statut Membre Dernière intervention 13 avril 2007 8
22 mai 2005 à 12:44
fr.php.net tu as tout :-)

<hr size="2" width="100%">




<li>Entraide, dépannage et vulgarisation informatique: Mon site de vulgarisation informatique</li>
0
hoodlum Messages postés 57 Date d'inscription lundi 16 mai 2005 Statut Membre Dernière intervention 24 septembre 2010
22 mai 2005 à 13:04
G regardé ce site mais je vois tjrs pas comment l'utilisé dans mon script!!
HELP ME
0
malalam Messages postés 10839 Date d'inscription lundi 24 février 2003 Statut Membre Dernière intervention 2 mars 2010 25
22 mai 2005 à 17:03
hello,



isset() sert a tester l'existence de variables, cela me semble en effet tout indique...

Ensuite, si ton script ne rentre pas dans ta boucle while, c'est sans
doute que sa condition n'est pas respectee. Bref, ta requete
fonctionne, mais ne renvoie aucun enregistrement...

Fais un mysql_num_rows() avant et affiche le resultat, il y a de grandes chances que ce soit 0.
0
hoodlum Messages postés 57 Date d'inscription lundi 16 mai 2005 Statut Membre Dernière intervention 24 septembre 2010
22 mai 2005 à 21:03
Salut Malalam

je te remercie effectivement mysql_num_rows indik 0 et c pour sa ke sa na marche !!il y avait un pb dans la base
encore merci
0
Rejoignez-nous