How do I grab the values stored in the fields 'startdate' and 'cycle' that belong to the row with OrderID? This is the code I'm using:
<?
$dbh=mysql_connect ("localhost", "whatnott_user", "password") or die ('I cannot connect to the database because: ' . mysql_error());
mysql_select_db ("whatnott_customer");
?>
<?
if($form=="form1"){
if(empty($orderID)){
$error.="You must enter your Order ID number.<br>\n";
}
$ID=mysql_fetch_row(mysql_query("select ID from customer_info where ID='".addslashes(trim($orderID))."'"));
if ($ID[0]<=0){
$error.="There is no matching Order ID in our Database.<br>\n";
}else{
$startdate=mysql_query("select startdate from customer_info where ID='".addslashes(trim($orderID))."'");
$cycle=mysql_query("select cycle from customer_info where ID='".addslashes(trim($orderID))."'");
}
if(!empty($error)){
$form="form1";
}else{
$form="form2";
}
}
?>
I can get it to verify that the orderID exist in the database. But from there it isn't grabbing the values stored in 'startdate' and 'cycle' that belong to the supplied orderID.
This is what I get back as my value:
Resource id #4
Resource id #5
Can someone please help me?