Location: PHPKode > projects > Einkaufszettelgenerator > EZettel0.1/prod_db.php
<HTML>

<LINK REL="stylesheet" TYPE="text/css" HREF="menu.css">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=KOI8-R">
<title>Menu - Produklist rezult</title>

</head>
<body class="body1">
<?
include("menu.ini");

$i=1;
 do {
$prod_id="prod_id_$i";
$prod_name="prod_name_$i"; 
$prod_type="prod_type_$i";
$prod_price="prod_price_$i";
$markt="markt_$i";
$menge="menge_$i";
$sel="sel_$i";
$const="const_$i"; 
//echo "prod_type=$_POST[$prod_type]<P>";
//echo "prod_id=$_POST[$prod_id]<P>"; 


$strsql_t = "select typ_id from prod_type  where (typ_name='$_POST[$prod_type]' and user_id='$us');";
   $result_t = mysql_query($strsql_t, $connection);
   $t=0;
    while ( $row_t = mysql_fetch_row($result_t) )
       {
        $t+=1;
        $_POST[$prod_type]=$row_t[0]; 
 //     echo "prod_type new=$_POST[$prod_type]<P>"; 
}    


$strsql = "UPDATE  product set prod_name='$_POST[$prod_name]', prod_type='$_POST[$prod_type]', prod_price='$_POST[$prod_price]', markt='$_POST[$markt]',menge='$_POST[$menge]', sel='$_POST[$sel]', const='$_POST[$const]' where (prod_id='$_POST[$prod_id]');";

//echo "$strsql <P>";

 $result = mysql_query($strsql); 
$i=$i+1;
 }
 while ($_POST[$prod_id]!='');




echo "<TABLE border=1  CELLSPACING=0 CELLPADDING=5 class=prod><TR class=table><TD>ID</TD><TD>Name</TD><TD>Type</TD><TD>Price</TD></TD><TD>Menge</TD><TD>Markt</TD><TD>Immer</TD><TR>";
   $strsql1 = "select p.prod_name,t.typ_name,p.prod_price, p.menge,p.markt, p.prod_id, p.const from product p, prod_type t where (t.typ_id=p.prod_type) and t.user_id='$us' ORDER BY prod_type;";
   $result1 = mysql_query($strsql1, $connection);
   $i=0;
    while ( $row = mysql_fetch_row($result1) )
       {
        $i+=1;
echo "<TR><TD>$row[5]</TD><TD>$row[0]</TD><TD>$row[1]</TD><TD>$row[2]</TD><TD>$row[3]</TD><TD>$row[4]</TD><TD>$row[6] </TD><TR>";
       }

echo "</TABLE><P><P><P> ";

?>
</TABLE>    
Return current item: Einkaufszettelgenerator