hi everyone i am having a problem in my mysql class to retrieve the stored data in database.
i want to retrieve data in view class calling controller class and then model class for select query. plz help me
the code is bellow.
call from view to controller in line no 3
$sel=new SelectSubject();
$selquery=0;
$select=$sel->get($selquery);
while($rs=mysql_fetch_array($select))
{
$var=$rs['subject_code'];
$sub=$rs['Name'];
?><tbody>
<tr>
<td align="center"><?php echo $rs['subject_code']; ?></td>
<td align="center"><?php echo "<a href='newpage.php?code=$var&Name=$sub'> $rs[Name]</a><br/>"; ?></td></table>
the controller class code is
The controller class call model in line no 12
class SelectSubject
{ var $select;
function get($selectquery)
{
$this->select=$selectquery;
$selectsubject=new LoginSystem();
$selectsubject->getSubject($this->select);
}
}
the model class code is
function getSubject($queryselect)
{ $this->selectquery=$queryselect;
$this->connect();
$this->selectquery="select * from subject";
$result=mysql_query($this->selectquery, $this->connection)or die(mysql_error());
return $result;
plz help me whats going wrong with this code it dosn't work.