Jump to content

Checking an enum


graham23s

Recommended Posts

Hi Guys,

 

what i'm trying to do here is check the database for a Y if the order has a Y beside it (denoting a P medecine) you get sent to the cart.php page to fill in some questions:

 

code:

 

<?php
// do a check to see if any of the products are [P]
$q_p = "SELECT `p_med` FROM `fcp_orders` WHERE `customer_id`='$session_id '"; 
$r_p = mysql_query($q_p);
$a_p = mysql_fetch_array($r_p);

// P
$P = $a_p['p_med'];

// check
if ($P == 'Y')
{
  // back to cart
  header("Location: cart.php");
} 

?>

 

i need to loop through the table i guess to see if the $P i s set to Y but not sure the best way!

 

thanks for any help guys

 

Graham

Link to comment
https://forums.phpfreaks.com/topic/124223-checking-an-enum/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.