Login   Register  
PHP Classes
elePHPant
Icontem

File: shopping_cart_global_func.php

Recommend this page to a friend!
Stumble It! Stumble It! Bookmark in del.icio.us Bookmark in del.icio.us
  Classes of DavidLanz  >  Hippo Shopping Cart  >  shopping_cart_global_func.php  >  Download  
File: shopping_cart_global_func.php
Role: Auxiliary script
Content type: text/plain
Description: global function
Class: Hippo Shopping Cart
Manage shopping cart of products stored in MySQL
Author: By
Last change:
Date: 8 years ago
Size: 1,452 bytes
 

Contents

Class file image Download
<?php 
  
function check_if_products_id_exist($products_id)
  {
    if(
$products_id=="")
    {
      return 
false;
    }
    
    require(
'shopping_cart_DBVar.php');
    
    if(
$connection_method == "mysql")
    {
      
$my_sql=new hippo_sql_query($connection_method,$host,$dbName1,$dbUser,$dbPass,$dbPort);
      
$sql_stmt "SELECT COUNT(*) AS num_rows FROM ".$dbTable1." WHERE f_products_id='".$products_id."'";
      
$res $my_sql->query_exec($sql_stmt,"4");
      
$row $res[0]['num_rows'];
      
      
// $row should be 1 or products_id will duplicate
      
if($row>0){return true;}else{return false;}
      
    } 
// End if($connection_method == "mysql")
    
    
return false;
  }
  
  function 
check_if_user_exist($MemId$Email)
  {
    if(
$MemId=="" || $Email=="")
    {
      return 
false;
    }
    
    require(
'shopping_cart_DBVar.php');
    
    if(
$connection_method == "mysql")
    {
      
$my_sql=new hippo_sql_query($connection_method,$host,$dbName1,$dbUser,$dbPass,$dbPort);
      
$sql_stmt "SELECT COUNT(*) AS num_rows FROM ".$dbTable2." WHERE f_customer_id='".$MemId."' AND f_email='".$Email."'";
      
$res $my_sql->query_exec($sql_stmt,"4");
      
$row $res[0]['num_rows'];
      
      
// $row should be 1 or products_id will be duplicated
      
if($row>0){return true;}else{return false;}
    } 
// End if($connection_method == "mysql")
    
    
return false;
  }
  
?>