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