TimkiemSOSD/adminTest/model/prod_model.php
//cac phuong thuc tuong tac bang tblcategory
cac phuong thuc tuong tac bang tblcategory
cac phuong thuc tuong tac bang tblcategory
public static function insert($name,$quantity,$price,$image,$description,$cateId,$discountPrice=0){
			$con = DB::getConnection();
			$sql = "INSERT INTO tblproduct (name,quantity,price,discountPrice,image,description,cateid) VALUES(?,?,?,?,?,?,?)";
			try{
				$pst = $con->prepare($sql);
				$pst->bindValue(1,$name);
				$pst->bindValue(2,$quantity);
				$pst->bindValue(3,$price);
				$pst->bindValue(4,$discountPrice);
				$pst->bindValue(5,$image);
				$pst->bindValue(6,$description);
				$pst->bindValue(7,$cateId);
				$pst->execute();
			}
			catch(PDOException $e){
				echo $e->getMessage();
			}
		}
public static function insert ( $ name , $ quantity , $ price , $ image , $ description , $ cateId , $ discountPrice = 0 ) { $ con = DB :: getConnection ( ) ; $ sql = " INSERT INTO tblproduct (name,quantity,price,discountPrice,image,description,cateid) VALUES(?,?,?,?,?,?,?) " ; try { $ pst = $ con -> prepare ( $ sql ) ; $ pst -> bindValue ( 1 , $ name ) ; $ pst -> bindValue ( 2 , $ quantity ) ; $ pst -> bindValue ( 3 , $ price ) ; $ pst -> bindValue ( 4 , $ discountPrice ) ; $ pst -> bindValue ( 5 , $ image ) ; $ pst -> bindValue ( 6 , $ description ) ; $ pst -> bindValue ( 7 , $ cateId ) ; $ pst -> execute ( ) ; } catch ( PDOException $ e ) { echo $ e -> getMessage ( ) ; } }
cac phuong thuc tuong tac bang tblcategory
cac phuong thuc tuong tac bang tblcategory