January 28, 2011

my class file

<?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

Integrating Google reCAPTCHA v3 in HTML Form with PHP

  What is Google reCAPTCHA v3? Google reCAPTCHA is a free service that helps protect websites from spam and abuse. reCAPTCHA v3 is the lates...