Jump to content
Larry Ullman's Book Forums

Recommended Posts

I am using the structure of Script 3.5 (Calculator.php) to tackle the issue of recording attendance for persons listed in a MySQL database.  I am using this structure because I am attempting to create a web page that will handle a form and then display it again.  Larry mentions this function on page 86.

I plan to use input type="checkbox" name="checkbox[]" value="full_name".  The value part is where I am having trouble.  I want to select a person's name from a table in the database so that the name will appear on the form on the same line with the checkbox.

 

The page is in two parts, the first part being for php code, and the second part being for the html form.  To place on the form a checkbox I need to list a person's name with that input.  I can query the database in the php section and fetch from the array of results each person's name.

Can anyone suggest where in the code I can fetch the names and then use them in the input for checkboxes?

 

I hope this makes sense.  I want to record attendance for all persons in a table who are present at a meeting.  I want to list the names of all persons in the table along with a checkbox that can be checked to indicate they were present.

 

I will appreciate any guidance that can be shared to help me in designing a plan to accomplish this.

 

Thank you.

 

Wes (wesmith4@gmail.com)

Share this post


Link to post
Share on other sites

I would do the SELECT query just before the HTML form. I'd display the names but use the user ID from the table (or whatever primary key) as the value of the checkboxes. Also, if you keep reading, there will be examples closer to this (that both display and handle a form, but use a database as the source). 

Share this post


Link to post
Share on other sites

Thanks Larry!  You said it well. I am seeking a plan that both displays and handles a form, but use a database as the source.

I will keep reading, but I am not sure about reading from ?????.

Again, Thank you.

wes

 

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...

×
×
  • Create New...