prob with class
Posted: Thu Feb 27, 2003 12:28 pm
Code: Select all
<?
class dataset {
var $sets = array();
function pros() {
$this->info =
array(
);
include("dbs.php");
$lk = mysql_connect($serv,$user,$pass) or die(mysql_error());
mysql_select_db($dbnameї0],$lk);
$qur = "select * from pollqa order by id desc limit 1";
$res = mysql_query($qur) or die ( "Error display \n" .mysql_error());
$row = mysql_fetch_assoc($res);
$this->setsї0] = $rowї'qs'];
$this->setsї1] = $rowї'ans1'];
$this->setsї2] = $rowї'ans2'];
$this->setsї3] = $rowї'ans3'];
$this->setsї4] = $rowї'ans4'];
$this->setsї5] = $rowї'ans5'];
$this->setsї6] = $rowї'ans6'];
return $this->sets;
}
}
?>Code: Select all
$row = mysql_fetch_assoc($res);
$this->setsї0] = $rowї'qs'];
$this->setsї1] = $rowї'ans1'];
$this->setsї2] = $rowї'ans2'];
$this->setsї3] = $rowї'ans3'];
$this->setsї4] = $rowї'ans4'];
$this->setsї5] = $rowї'ans5'];
$this->setsї6] = $rowї'ans6'];
return $this->sets;why is that?