View Single Post
  #3 (permalink)  
Old 03-14-10, 04:45 AM
Raffikki529 Raffikki529 is offline
Newbie Coder
 
Join Date: Mar 2010
Posts: 5
Thanks: 1
Thanked 0 Times in 0 Posts
PHP Code:

<html>
<body bgcolor="#333333" style="color:white; font-family:Verdana, Geneva, sans-serif;" >
                                                                    
                                                                        <table border="1" bordercolor="#000000" bgcolor="#00FFFF" style="color:black" width="985px">
                                                                        
                                                                        <tr>
                                                                        <th width="300px">Product</th>
                                                                        <th width="300px">Part #</th>
                                                                        <th width="300px">Supplier</th>
                                                                        <th>Amount</th>
                                                                        </tr>
                                                                        
<?                                                                        


$host 
"localhost";
$user "root";
$pass "";
$database "products";

$linkID mysql_connect($host$user$pass) or die("Could not connect to host.");
mysql_select_db($database$linkID) or die("Could not find database.");

$query "SELECT * FROM products ORDER BY supplier, product";
$resultID mysql_query($query$linkID) or die("Data not found.");


while(
$row mysql_fetch_array($resultID))

          {
            
            
$fok $row['id'];
            
$amount $_POST[$fok] . "</td>";

if (
$amount != 0) {
                                                
                                            
            



                                                            echo 
"<tr><td>";
                                                            echo 
$row['Product'] . "</td><td>";

                                                            
                                                            echo 
$row['Part_Number'] . "</td><td>";
                                                            
                                                            echo 
$row['Supplier'] . "</td><td>";
                                                            
                                                            echo 
$amount;
                                                            
                                                            echo 
"</tr>";
                                                            
                                                            


            
                
                }
        }
        echo 
"</table>";
        
?>
        
</html>
This file is included in a submit.php file.
If the inc file is set as a variable and displayed again, it displays "1".
Reply With Quote