close ad
Databridge V2 with MySQLi support IS Now Available!
open ad
View Menu

Technical Support Forums

Free, outstanding support from WebAssist and your colleagues

While Loop

Thread began 9/15/2009 11:42 am by Daryl | Last modified 9/16/2009 5:00 pm by Daryl | 2497 views | 5 replies

DarylBeta Tester

While Loop

I am desperately trying to create an email form that has a number of checkboxes at the top of the page that allows the user to select multiple people (one email address per check box) or a department (multiple emails per checkbox).

I can get a single email address to echo from the database into the value fields for the people, but I am having issues getting all email addresses from specific column into a checkbox value.

I have been trying to learn to use the while loop but haven't managed to get it to work successfully yet.

To start with, I do not need to have checkboxes, but I do need a way that the user can select multiple people or groups of people to send the message to - if you have any other suggestions please let me know.

The method that I am using to loop the records is as follows;


mysql_connect("localhost""username""password") or die("Error connecting to database");
$result mysql_query("SELECT * FROM units"$connection) or die("error querying database");?>

Then this for the first checkbox;

<?php while($row_rs mysql_fetch_assoc($result)){


Then this for the second;

<?php while($row_rs mysql_fetch_assoc($result)){


But unfortunately the second set doesn't produce any results from the recordset.

Where am I going wrong?

I'm sure there must be an easier way....

Build websites with a little help from your friends

Your friends over here at WebAssist! These Dreamweaver extensions will assist you in building unlimited, custom websites.

Build websites from already-built web applications

These out-of-the-box solutions provide you proven, tested applications that can be up and running now.  Build a store, a gallery, or a web-based email solution.

Want your website pre-built and hosted?

Close Windowclose

Rate your experience or provide feedback on this page

Account or customer service questions?
Please user our contact form.

Need technical support?
Please visit support to ask a question





Ease of use


security code refresh image

We do not respond to comments submitted from this page directly, but we do read and analyze any feedback and will use it to help make your experience better in the future.

Close Windowclose

We were unable to retrieve the attached file

Close Windowclose

Attach and remove files

add attachmentAdd attachment
Close Windowclose

Enter the URL you would like to link to in your post

Close Windowclose

This is how you use right click RTF editing

Enable right click RTF editing option allows you to add html markup into your tutorial such as images, bulleted lists, files and more...

-- click to close --

Uploading file...