[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.

Question
[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!

7.8

Changing a query depending on date

Asked by horalia in PHP Scripting Language

Hi experts, this is a tricky one, at least for a newbie like me. I'm not sure if I should post this question here or in the JavaScript section, I'll let you guys decide. I have three tables, press_schedule, prerun_rpt and publications.

mysql> describe press_schedule;
+------------+-------------+------+-----+---------+----------------+
| Field      | Type        | Null | Key | Default | Extra          |
+------------+-------------+------+-----+---------+----------------+
| press_id   | smallint(6) | NO   | PRI | NULL    | auto_increment |
| press_date | date        | NO   | MUL |         |                |
| pub_id     | smallint(6) | NO   | MUL |         |                |
+------------+-------------+------+-----+---------+----------------+
3 rows in set (0.11 sec)

mysql> describe prerun_rpt;
+-------------+--------------+------+-----+---------+----------------+
| Field       | Type         | Null | Key | Default | Extra          |
+-------------+--------------+------+-----+---------+----------------+
| rpt_id      | int(11)      | NO   | PRI | NULL    | auto_increment |
| rpt_date    | date         | NO   |     |         |                |
| pages       | smallint(6)  | YES  |     | NULL    |                |
| sections    | smallint(6)  | YES  |     | NULL    |                |
| pub_id      | smallint(6)  | NO   |     |         |                |

mysql> describe publication;
+----------+--------------+------+-----+---------+-------+
| Field    | Type         | Null | Key | Default | Extra |
+----------+--------------+------+-----+---------+-------+
| pub_id   | smallint(6)  | NO   | PRI |         |       |
| pub_name | varchar(100) | NO   |     |         |       |
+----------+--------------+------+-----+---------+-------+
2 rows in set (0.03 sec)

The table press_schedule contains the schedule for the press to run, and the night crew creates a report (prerun_rpt) for each press run that is scheduled. I have created a form for for the prerun_rpt table. It contains a calendar from where the user selects a date, and a drop down box with all the publications from where the user can pick up a publication. What I would like to do, is narrow down the amount of publications depending on the date contained in press_schedule.

Let say that press_schedule has the following information:

mysql> select * from press_schedule;
+----------+------------+--------+
| press_id | press_date | pub_id |
+----------+------------+--------+
|        1 | 2006-09-10 |  10200 |
|        2 | 2006-09-10 |  10201 |
|        3 | 2006-09-10 |  10202 |
|        4 | 2006-09-11 |  10201 |
|        5 | 2006-09-12 |  10202 |
+----------+------------+--------+
5 rows in set (0.00 sec)

And that publication has the following:

mysql> select * from publication;
+--------+----------------------------------+
| pub_id | pub_name                         |
+--------+----------------------------------+
|  10200 | TV Week                          |
|  10201 | Best Bets                        |
|  10202 | Lyon County Tab 01520000         |

When the user creates a report for '2006-09-10', only three choices will be shown in the drop down box, 'TV Week', 'Best Bets' and 'Lyon County Tab 01520000'. If the user chooses '2006-09-11', only one option will show, 'Best Bets'. How can I accomplish this? I'm using PHP and MySQL. Thanks!



[+][-]10/12/06 12:58 PM, ID: 17718759Accepted Solution

Your question has an Asker Certified™ answer! horalia verified that this solution worked for them--which means it will likely work for you, too. Click to view the solution free for 30-days now.

About this solution

Zone: PHP Scripting Language
Sign Up Now!
Solution Provided By: CraigHarris
Participating Experts: 1
Solution Grade: A
 
[+][-]10/11/06 02:02 PM, ID: 17710725Expert Comment

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.

 
[+][-]10/11/06 02:36 PM, ID: 17710989Author Comment

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.

 
[+][-]10/11/06 02:39 PM, ID: 17711019Author Comment

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.

 
[+][-]10/13/06 09:53 AM, ID: 17725741Author Comment

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.

 
[+][-]11/09/06 12:10 PM, ID: 17909001Administrative Comment

Experts Exchange has a courteous staff of administrators who help members get the most out of the website by means of administrative comments like this one.

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

 
[+][-]11/14/06 07:42 PM, ID: 17943795Administrative Comment

Experts Exchange has a courteous staff of administrators who help members get the most out of the website by means of administrative comments like this one.

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

 
 
Loading Advertisement...
20100308-EE-VQP-140 - Hierarchy
Your technology problems solved.
Close See Plans and Pricing. Try it FREE for 30 days.