" " && $_SESSION["sessionUserID"] > " "){ $sql = "select * from cookbook where (Recipe_ID='$recid' and User_ID = '" . $_SESSION["sessionUserID"] . "')"; $result = mysql_query($sql) or die(mysql_error()); if($myrow=MySQL_fetch_array($result)){ $added = "The recipe was added to your Cookbook." ; } else { $sqlR = "INSERT INTO cookbook (User_ID, Recipe_ID) VALUES ('" . $_SESSION['sessionUserID'] . "', '$recid')"; mysql_query($sqlR); $added = "The recipe was added to your Cookbook." ; } } if($_REQUEST["act"] == "y" && $recid > " " && !$_SESSION["sessionUserID"]){ $added = "Please login or register to add this recipe to your Cookbook." ; } $sqlrp = "select * from recipes where (ID='$recid')"; $resultrp = mysql_query($sqlrp) or die(mysql_error()); if($myrowrp=MySQL_fetch_array($resultrp)){ $photo = $myrowrp["Photo"]; $Recipe_Name = $myrowrp["Recipe_Name"]; $User_ID = $myrowrp["User_ID"]; $winner = $myrowrp["winner"]; if(($myrowrp["Prep_Time_Hours"] > " ") && ($myrowrp["Prep_Time_Minutes"] > " ")){ $prepTime = $myrowrp["Prep_Time_Hours"]. ":". $myrowrp["Prep_Time_Minutes"] ; } if($myrowrp["Prep_Time_Hours"] > " " && $myrowrp["Prep_Time_Minutes"] < " "){ $prepTime = $myrowrp["Prep_Time_Hours"] . ":00" ; } if($myrowrp["Prep_Time_Hours"] < " " && $myrowrp["Prep_Time_Minutes"] > " "){ $prepTime = $myrowrp["Prep_Time_Minutes"] . "min" ; } if($myrowrp["Total_Time_Hours"] < " " && $myrowrp["Total_Time_Minutes"] > " "){ $totTime = $myrowrp["Total_Time_Minutes"] . "min" ; } if($myrowrp["Total_Time_Hours"] > " " && $myrowrp["Total_Time_Minutes"] > " "){ $totTime = $myrowrp["Total_Time_Hours"] . ":" . $myrowrp["Total_Time_Minutes"] ; } if($myrowrp["Total_Time_Hours"] > " " && $myrowrp["Total_Time_Minutes"] < " "){ $totTime = $myrowrp["Total_Time_Hours"] . ":00" ; } } //get the user who submitted this $submitBy = "A Yadahome user"; $sqlU = "select * from users where (ID = '$User_ID') "; $resultU = mysql_query($sqlU) or die(mysql_error()); if($myrowU=MySQL_fetch_array($resultU)){ $submitBy = $myrowU["First_Name"]; if( ($myrowU["State_Reside"] > " ") && ($myrowU["City"] > " ")){ $submitBy .= " of " . $myrowU["City"] . ", " . $myrowU["State_Reside"]; } if( ($myrowU["City"] > " ") && ($myrowU["State_Reside"] <= " ") ){ $submitBy .= " of " . $myrowU["City"]; } if( ($myrowU["City"] <= " ") && ($myrowU["State_Reside"] > " ") ){ $submitBy .= " of " . $myrowU["State_Reside"]; } } $rating = 3; //get recipe rating $recid $sqlr = "select round(avg(Rating)) as Rating from ratings where For_Recipe_ID = '$recid'"; $resultr = mysql_query($sqlr) or die(mysql_error()); if($myrowr=MySQL_fetch_array($resultr)){ $rating = $myrowr["Rating"]; if($rating < 1){ $rating = 1;} if($rating > 5){ $rating = 5;} if($myrowr["Rating"] == 0){$rating = 3;} } //******************************* ?> Recipe for <?= $Recipe_Name ?>
share recipes
recipes
 

"0000-00-00"){?> [Winner!]
submitted by

" "){ ?>

 

" "){ ?> " "){?> " "){?>
[go to my cookbook]
prep time: | total time: | serving size:
Ingredients

Instructions

 


 

 
colors