syntax

I am tring to make on htmlwrite(" ");
how to make correct syntax for

 $querycomp = "Select * from customer order by custid ASC";  
   $resultcomp = mysql_query($querycomp);       
      $count=0;
    while($row  = mysql_fetch_array($resultcomp)){
      $count++;
      echo "<option value>".$row['company']."</option>";
      }
            
to put into htmlwrite(" ");

Thank you in advance
--------------------------------


htmlwrite("
      <a href=\"admin.php\">return to overview</a>
    <form name=\"form1\" method=\"post\" action=\"user.php?action=adduserconfirmed\">
    <p>Username: <input name=\"ADD_username\" type=\"text\" id=\"ADD_Username\"><br>
    Password: <input name=\"ADD_password\" type=\"text\" id=\"ADD_password\"><br>
   
      First Name : <input name=\"ADD_fname\" type=\"text\" id=\"ADD_fname\"><br>
    Last Name : <input name=\"ADD_lname\" type=\"text\" id=\"ADD_lname\"><br>

    E-mail : <input name=\"ADD_mailadres\" type=\"text\" id=\"ADD_mailadres\"><br>

    Company : <select name=\"ADD_company\" type=\"text\" id=\"ADD_company\"> ");

   $querycomp = "Select * from customer order by custid ASC";  
   $resultcomp = mysql_query($querycomp);       
      $count=0;
    while($row  = mysql_fetch_array($resultcomp)){
      $count++;
      echo "<option value>".$row['company']."</option>";
      }
                  
htmlwrite("      
      </select><br>
    Phone : <input name=\"ADD_phone\" type=\"text\" id=\"ADD_phone\"><br>
    Userlevel: <input name=\"ADD_Userlevel\" type=\"text\" id=\"ADD_Userlevel\" value=\"1\"><br>
      <input name=\"ADD_activated\" type=\"checkbox\" value=\"1\" checked>Activate on create<br>
      <input name=\"ADD_MailActnum\" type=\"checkbox\" value=\"1\">Mail activationcode mail (only for unactivated accounts).
    <br>
    <input type=\"submit\" value=\"ADD USER\"></p></form>","ADD USER");
bbvicAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

geir_andersenSystems engineerCommented:
your code looks OK, but the select box you create, doesn't contain a value, once submitted.
change:
$querycomp = "Select * from customer order by custid ASC";  
   $resultcomp = mysql_query($querycomp);      
     $count=0;
    while($row  = mysql_fetch_array($resultcomp)){
     $count++;
     echo "<option value>".$row['company']."</option>";
     }

this, to sort that out:
$querycomp = "Select * from customer order by custid ASC";  
   $resultcomp = mysql_query($querycomp);      
     $count=0;
    while($row  = mysql_fetch_array($resultcomp)){
     $count++;
     echo "<option value=\"{$row['company']}\">{$row['company']}</option>\n";
     }

this will submit the same value when you post the form, as is dislpayed on the screen in the form.
(note! if you're wondering about the \n I added, it's simply to make your html code more readable.)

-Geir

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
basiclifeCommented:
Also, it's good to learn to do it the manual way, but once you've got the hang of it, look at the EzSQL class here: http://php.justinvincent.com/ it makes everything so much easier and saves you writing the same 100 lines of code every time you want to use a database
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
PHP

From novice to tech pro — start learning today.