[x]
Posted via EE Mobile

Search, ask, and monitor your questions on the go with EE Mobile. Visit Experts Exchange from your mobile device and never be out of touch again.

08/17/2005 at 09:55PM PDT, ID: 21531120
[x]
Attachment Details
[x]
The Solution Rating System

With so many solutions, how can you tell which solutions are most likely to help you and which ones are not? To provide you with a tool to use, we rate our solutions based on various elements that most accurately determine if a solution is a quality solution. To explain what factors affect the solution rating, here are the elements we take into consideration when formulating our solution rating.

  • The Grade of the Solution
  • The Zone Rank of the Expert Providing the Solution
  • The Number of Author and Expert Comments
  • The Number of Experts Contributing
  • The Feedback of the Community

Your Input Matters
Because of the way the system is set up, the most important variable in this equation is you. As a member of Experts Exchange, you are able to cast your vote on the quality of the solutions in regard to how complete, accurate, helpful and easy to understand each solution is. When you provide your feedback, each rating is adjusted accordingly. So, if you see a solution that has a poor rating that you think is a good solution, let us know by rating it. As you do, the rating will be adjusted and will become more accurate for other members of our site.

If you have any suggestions that you would like to make for our rating system, please ask a question in the Suggestions Zone of Community Support.

Thank you!

8.0

Dropdown items conditional on sum of rows in different table

Asked by jwoker in PHP and Databases

Tags: dropdown, enrollment

The code below works to create a dropdown list selection box with data from table COURSE.  Now I need to modify this so that only courses which have not reached their enrollment capacity are listed.  Table COURSE also has a field CAPACITY which is int and stores the number of seats in a course.  There is another table in my database which stores registration information, table STUDENTS which has the fields ID, USERID, COURSEID.  

I would like the dropdown list to be populated with COURSE.FULLNAMEs where the number of students has not reached COURSE.CAPACITY.  So I think I need something to calculate the number of times a particular COURSEID shows in table STUDENTS if that number is less than the relevant CAPACITY then go ahead and list the FULLNAME.  Please help with query language and php code.

-------------------------------------
<form action="registration_process.php" method="post" enctype="multipart/form-data">
     <tr>
            <td width="132" height="29" valign="top"><div align="left">Course Name:</div></td>
            <td width="423" valign="top"><input type="hidden" name="react" value="select_course">
                <select name="coursename" size="1">
<?php
$mysql_link = mysql_connect("localhost","user","pass");
mysql_select_db(moodle, $mysql_link);

$query = "SELECT fullname,id FROM course ";
$result = mysql_query($query, $mysql_link);
if(mysql_num_rows($result)) {
      // we have at least one course, so show all courses as options in select form
      while($row = mysql_fetch_row($result))
      {
            // the if is to exclude the site main page course from showing as a selection
            if ("1"!=$row[1]) print("<option value=\"$row[0]\">$row[0]</option>");
      }
} else {
      print("<option value=\"\">No courses created yet</option>");
}
?>
              </select></td>
            <td width="6" valign="top"><span class="style1">*</span></td>
          </tr>

--------------------
[+][-]08/17/05 10:38 PM, ID: 14698137

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 30-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]08/17/05 11:33 PM, ID: 14698275

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 30-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]08/18/05 02:32 AM, ID: 14698942

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 30-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]08/18/05 08:12 AM, ID: 14701244

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 30-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]08/18/05 08:33 AM, ID: 14701493

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 30-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]08/18/05 03:24 PM, ID: 14704983

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 30-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]08/18/05 06:23 PM, ID: 14705738

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 30-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]08/18/05 06:24 PM, ID: 14705745

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 30-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]08/18/05 07:04 PM, ID: 14705906

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 30-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]08/18/05 07:11 PM, ID: 14705928

View this solution now by starting your 30-day free trial. Setting up your free trial is quick, easy, and secure. We will return you to this solution, unlocked, when you're done.

 

About this solution

Zone: PHP and Databases
Tags: dropdown, enrollment
Sign Up Now!
Solution Provided By: WoodyRoundUp
Participating Experts: 1
Solution Grade: A
 
 
[+][-]08/18/05 08:01 PM, ID: 14706130

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 30-day free trial to view this Author Comment or ask the Experts your question.

 
 
Loading Advertisement...
20091111-EE-VQP-91