not sure what im doign wrong 🙂
heres the call to the function
if (checkdupe($shirtname,$ccode,$sizeid))
{
$error ="yes";
}
else
{
$error ="no";
}
and the function itself.
//----------------checkdupe function-------------------------
function checkdupe($shirtname,$ccode,$sizeid)
{
if (isset($_COOKIE['username']))
{
$id = $_COOKIE['username'];
}
else
{
$id = $_COOKIE['notlogged'];
}
$test =$shirtname.$ccode.$sizeid;
$sql = "Select * from client_order where ordercode ='$test' and login ='$id'";
$findout = mysql_query($sql) or die(mysql_error());
$num_rows = mysql_num_rows($findout);
if ($num_rows <= 0)
{
//failed
return 0;
}
else
{
//pass
return 1;
}
}
//-----------------------------------------------------------
any suggestions ?
cheers
vamps