<?php
class User
{
public function SelectRecords()
{
$sr_u = "select * from category";
$o_user = mysql_query($sr_u);
$data = array();
while($as__user = mysql_fetch_assoc($o_user))
{
$data[] = $as__user;
}
return $data;
}
public function InserRecod()
{
extract($_POST);
$ss__qr = "insert into category values('','$t1')";
$o_user = mysql_query($ss__qr);
}
public function SelectRecordspro()
{
$sr_u = "select * from product";
$o_user = mysql_query($sr_u);
$data = array();
while($as__user = mysql_fetch_assoc($o_user))
{
$data[] = $as__user;
}
return $data;
}
public function InserRecodpro()
{
extract($_POST);
$ss_qr = "insert into product values('','$name','$qty','$price','')";
$o_user = mysql_query($ss_qr);
}
public function deleteRecord()
{
extract($_POST);
$db = "delete from category where id_category =" .$_GET['id_category'];
mysql_query($db);
header('Location:category_view.php');
}
}
?>
class User
{
public function SelectRecords()
{
$sr_u = "select * from category";
$o_user = mysql_query($sr_u);
$data = array();
while($as__user = mysql_fetch_assoc($o_user))
{
$data[] = $as__user;
}
return $data;
}
public function InserRecod()
{
extract($_POST);
$ss__qr = "insert into category values('','$t1')";
$o_user = mysql_query($ss__qr);
}
public function SelectRecordspro()
{
$sr_u = "select * from product";
$o_user = mysql_query($sr_u);
$data = array();
while($as__user = mysql_fetch_assoc($o_user))
{
$data[] = $as__user;
}
return $data;
}
public function InserRecodpro()
{
extract($_POST);
$ss_qr = "insert into product values('','$name','$qty','$price','')";
$o_user = mysql_query($ss_qr);
}
public function deleteRecord()
{
extract($_POST);
$db = "delete from category where id_category =" .$_GET['id_category'];
mysql_query($db);
header('Location:category_view.php');
}
}
?>
No comments:
Post a Comment