我是新手,请原谅我缺乏经验的知识。我有一堂PHP课。它使一些数据库工作。但我无法将结果作为数组。
public function __construct($sunucu, $kullaniciAdi, $kullaniciSifre, $veritabaniAdi){
$this->_baglanti= mysql_connect($sunucu, $kullaniciAdi,$kullaniciSifre);
mysql_select_db($veritabaniAdi,$this->_baglanti);
}
public function baglantiyiKopar(){
mysql_close($this->_baglanti);
}
public function sorgula($sorgu){
$this->_donenSonuclar = mysql_query($sorgu, $this->_baglanti);
$this->_satirSayisi = mysql_num_rows($this->_donenSonuclar) ;
}
public function satirSayisi(){
return $this->_satirSayisi;
}
public function satirlar(){
$satirlar = array();
for($st=0;$st< $this->_satirSayisi;$st++){
$satirlar = mysql_fetch_assoc($this->_donenSonuclar);
}
return $satirlar;
}
}
?>