A voir également:
- Problème mysql_fetch_assoc et $this->
- This program cannot be run in dos mode ✓ - Forum Programmation
- This is the mail system at host ✓ - Forum Mail
- This product requires the java language, which is either disabled or not available on this browser. ✓ - Forum Réseau
- Press up to unlock this screen ✓ - Forum Logiciels
- Sorry, something went wrong. we're working on getting this fixed as soon as we can. ✓ - Forum Facebook
1 réponse
Bonjour,
Essai en mettant des getters et setters dans ta classe :
l.1 class Class {
l.2
l.3 var $result;
function setResult($result){
$this->result = $result;
}
function getResult(){
return $this->result;
}
l.4
l.5 function exemple(){
l.6
l.7 $this->result = mysql_query('Ma requete... correcte bien sur !');
l.8 }
l.9 }
l.10 $maclass = new Class;
l.11 $maclass->exemple();
l.12
l.13 while($row = mysql_fetch_assoc($maclass->getResult())){ ... }
En espérant que cela puisse t'aider.
Essai en mettant des getters et setters dans ta classe :
l.1 class Class {
l.2
l.3 var $result;
function setResult($result){
$this->result = $result;
}
function getResult(){
return $this->result;
}
l.4
l.5 function exemple(){
l.6
l.7 $this->result = mysql_query('Ma requete... correcte bien sur !');
l.8 }
l.9 }
l.10 $maclass = new Class;
l.11 $maclass->exemple();
l.12
l.13 while($row = mysql_fetch_assoc($maclass->getResult())){ ... }
En espérant que cela puisse t'aider.