Where is $number assignment? Because $number is ZERO, your code will not
run any statements in loop statement.

Larry



           
-----------------------------------------------------------------------------------------------------------------------
 
                                                                                       
                                            
                                               To: <[EMAIL PROTECTED]>                 
                                    
                                               cc:                                     
                                            
           "Philip J. Newman"                  Subject:  [PHP] Making a Loop.          
                                            
           <[EMAIL PROTECTED]>                                                         
                                        
           03/12/03 04:20 PM                                                           
                                            
                                                                                       
                                            
                                                                                       
                                            





I have this code to make this form list $x amount of times.

      for ($i = 1; $i <= $number; $i++) {

      echo"<select name=\"$number\" size=\"1\">";

       // LIST ALL PRODUCTS IN DATABASE.

       $sql = "SELECT * FROM products ORDER BY productCode ASC";
          $sql_result = mysql_query($sql, $connection) or die ("Could not
get Query");

          while ($row = mysql_fetch_array($sql_result)) {

       $productCode=$row["productCode"];
       echo "<option value=\"$productCode\">$productCode</option><br>";

       } // END WHILE.

         echo"</select>";


      }

and it dose not work any help?

------
Philip J. Newman.
Head Developer
[EMAIL PROTECTED]

+64 (9) 576 9491
+64 021-048-3999

------
Friends are like stars
You can't allways see them,
but they are always there.

------
Websites:

PhilipNZ.com - Design.
http://www.philipnz.com/
[EMAIL PROTECTED]

Philip's Domain // Internet Project.
http://www.philipsdomain.com/
[EMAIL PROTECTED]

Vital Kiwi / NEWMAN.NET.NZ.
http://www.newman.net.nz/
[EMAIL PROTECTED]



--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php







-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to