|
if ($pid==""){
$sql = "select collection_name from collections where id='".$cid."'";
$results=mysql_query($sql,$conn) or die("Query faild : " . mysql_error()) ;
$num = mysql_num_rows($results);
while ( $row = mysql_fetch_array($results))
{
$collection_name = $row['collection_name'];
$sql1 = "select product.id, product.collection_name, product.product_name,product.product_image from product where collection_name='". $collection_name."' limit 1";
$results1=mysql_query($sql1,$conn) or die("Query faild : " . mysql_error()) ;
while ($row1 = mysql_fetch_array($results1))
{
$nid = $row1['id'];
}}
}else{
$nid=$pid;
}
$sql = "select collection_name from collections where id='".$cid."'";
$results=mysql_query($sql,$conn) or die("Query faild : " . mysql_error()) ;
$num = mysql_num_rows($results);
while ( $row = mysql_fetch_array($results))
{
$collection_name = $row['collection_name'];
?>
$sql1 = "select product.id, product.collection_name, product.product_name,product.product_image from product where collection_name='". $collection_name."'";
$results1=mysql_query($sql1,$conn) or die("Query faild : " . mysql_error()) ;
while ($row1 = mysql_fetch_array($results1))
{
$pid = $row1['id'];
$product_name = $row1['product_name'];
$details = $row1['details'];
$image = $row1['image'];
?>
if ($pid == $nid)
{
?>
}
else
{
?>
}
?>
}
}
?>
|
 |
 |
 |
|
|
 |
| Nutritional Information |
 |
Ingredients |
 |
Recipes |
$did = $pid;
$sql = "select * from nu_info where id = '$did' ";
$results=mysql_query($sql,$conn) or die("Query faild : " . mysql_error()) ;
$num = mysql_num_rows($results);
while ( $row = mysql_fetch_array($results))
{
$id = $row['id'];
$nuname1 = $row['nuname1'];
$nuname2 = $row['nuname2'];
$nuname3 = $row['nuname3'];
$nuname4 = $row['nuname4'];
$nuname5 = $row['nuname5'];
$nuname6 = $row['nuname6'];
$nuname7 = $row['nuname7'];
$nuname8 = $row['nuname8'];
$nuname9 = $row['nuname9'];
$nuname10 = $row['nuname10'];
$nuvalue1 = $row['nuvalue1'];
$nuvalue2 = $row['nuvalue2'];
$nuvalue3 = $row['nuvalue3'];
$nuvalue4 = $row['nuvalue4'];
$nuvalue5 = $row['nuvalue5'];
$nuvalue6 = $row['nuvalue6'];
$nuvalue7 = $row['nuvalue7'];
$nuvalue8 = $row['nuvalue8'];
$nuvalue9 = $row['nuvalue9'];
$nuvalue10 = $row['nuvalue10'];
?>
if ($numame1 != "" OR $nuvalue1 != "")
{
?>
| echo $nuname1;?> |
 |
echo $nuvalue1;?> |
}
?>
if ($numame2 != "" OR $nuvalue2 != "")
{
?>
| echo $nuname2;?> |
echo $nuvalue2;?> |
}
?>
if ($numame3 != "" OR $nuvalue3 != "")
{
?>
| echo $nuname3;?> |
echo $nuvalue3;?> |
}
?>
if ($numame4 != "" OR $nuvalue4 != "")
{
?>
| echo $nuname4;?> |
echo $nuvalue4;?> |
}
?>
if ($numame5 != "" OR $nuvalue5 != "")
{
?>
| echo $nuname5;?> |
echo $nuvalue5;?> |
}
?>
if ($numame6 != "" OR $nuvalue6 != "")
{
?>
| echo $nuname6;?> |
echo $nuvalue6;?> |
}
?>
if ($numame7 != "" OR $nuvalue7 != "")
{
?>
| echo $nuname7;?> |
echo $nuvalue7;?> |
}
?>
if ($numame8 != "" OR $nuvalue8 != "")
{
?>
| echo $nuname8;?> |
echo $nuvalue8;?> |
}
?>
if ($numame9 != "" OR $nuvalue9 != "")
{
?>
| echo $nuname9;?> |
echo $nuvalue9;?> |
}
?>
if ($numame10 != "" OR $nuvalue10 != "")
{
?>
| echo $nuname10;?> |
echo $nuvalue10;?> |
}
?>
}
?>
|
 |
echo $ingredents;?> |
 |
/*
$sql1 = "select product.id, product.collection_name, product.product_name,product.product_image from product where collection_name='". $collection_name."'";
$results1=mysql_query($sql1,$conn) or die("Query faild : " . mysql_error()) ;
while ($row1 = mysql_fetch_array($results1))
{
$pid = $row1['id'];
$product_name = $row1['product_name'];
$details = $row1['details'];
$image = $row1['image'];
*/
?>
$isql= "select * from product where id = $pid";
$iresults=mysql_query($isql,$conn) or die("Query faild : " . mysql_error()) ;
$iline=mysql_fetch_array($iresults);
$iid= $iline['id'];
$product_image2= $iline['product_image2'];
//echo $product_image2;
$iresults=mysql_free_result($iresults);
//select product.id, recipes_info.id, recipes_info.rname from product left join recipes_info on product.id=recipes_info.id where recipes_info.id = '". $_REQUEST['pid']."'"
$sql2 = "select recipes_info.rname, recipes_info.id, recipes.id, recipes.name from recipes left join recipes_info on recipes.name=recipes_info.rname where recipes_info.id ='". $_REQUEST['pid']."' ";
$results2=mysql_query($sql2,$conn) or die("Query faild : " . mysql_error()) ;
while ($row2 = mysql_fetch_array($results2))
{
$id = $row2['id'];
$rname = $row2['rname'];
$product_image2 = $row2['product_image2'];
echo "$rname ";
}
?>
Add your own recipe |
|
|