Staff Induction System - No idea where to go from here!!!
Posted on
16th Feb 2014 07:03 pm by
admin
Hi there, I'm pretty new to PHP and Mysql so could really do with being pointed in the right direction with this problem I have.
I am trying to set up a system induct new members of staff onto their training programme.
First I have created a table 'induction_course_dates' of all the course dates and induction_course_titles of all the different courses.
These are the 2 queries I have made on the database
///////////////////////// Make the course title query //////////////////////////////
$q_courses = "SELECT * FROM induction_course_titles";
$result_courses = mysqli_query($dbc, $q_courses);
$row_courses = mysqli_fetch_array($result_courses);
///////////////////////// Make the course date query //////////////////////////////
$q_date = "SELECT * FROM induction_course_dates WHERE DATE(course_date)>='$today' AND course='$courseID' ORDER BY course_date ASC LIMIT 4";
$result_date = mysqli_query($dbc, $q_date);
$row_date = mysqli_fetch_array($result_date);
Obviously in the second query '$courseID' does not have a value so won't actually return anything but I don't know how to loop it through all of the induction_course_titles id's.
For example if it the query read...
///////////////////////// Make the course date query //////////////////////////////
$q_date = "SELECT * FROM induction_course_dates WHERE DATE(course_date)>='$today' AND course='2' ORDER BY course_date ASC LIMIT 4";
$result_date = mysqli_query($dbc, $q_date);
$row_date = mysqli_fetch_array($result_date);
...then this would return the results I'm looking for but there are 25 different courses.
I want the final output to appear as below
The user will select a date from the next four available
<table border="0" cellpadding="0" cellspacing="0">
<tr>
<td>Course 1</td>
<td>
<select name="select" id="select">
<option value="date1">Date 1</option>
<option value="date2">Date 2</option>
<option value="date3">Date 3</option>
<option value="date4">Date 4</option>
</select>
</td>
</tr>
<tr>
<td>Course 2</td>
<td><select name="select2" id="select2">
<option value="date1">Date 1</option>
<option value="date2">Date 2</option>
<option value="date3">Date 3</option>
<option value="date4">Date 4</option>
</select></td>
</tr>
<tr>
<td>Course 3</td>
<td><select name="select3" id="select3">
<option value="date1">Date 1</option>
<option value="date2">Date 2</option>
<option value="date3">Date 3</option>
<option value="date4">Date 4</option>
</select></td>
</tr>
<tr>
<td> </td>
<td><input type="submit" name="button" id="button" value="Submit" /></td>
</tr>
</table>
Can anybody help?!!!! PLEASE!!!!!
No comments posted yet
Your Answer:
Login to answer
51
36
Other forums
Retrieving the 25 most recently added entries from all tables in a MySQL databas
Hello,
The code below works great. It creates a table that shows the 25 most recently added t
Slow data retrieval which requires improvement..please help
I am working on a Help Desk Ticketing system and have a page called MY TICKETS which shows all ticke
quick question about System Change Number(SCN) in FlashBack Query topic
i know tht we can get the SCN of the database using flashback concept as follows
SQL>
New to PHP and just trying to understand a little code.
I hope I'm not annoying anyone or breaking the rules but I was wondering about this bit of code righ
Warning: mysql_num_rows() supplied argument is not a valid MySQL result resource
This may be simple I just may need another pair of eyes..
When i get records back the below c
Suggestions for Functional module
Hello experts,
I Have done B.Sc(Mathematics) and MCA & have learnt SAP/ABAP but do n
Save username into DB
OkaY so I got my blog to actually save the posts and whatever, all I need now is for it to keep the
Printer configuration
Hi All,
Suppose one of the user deleted the printer settings unfortunatly ,then what is the pro
disabling a button server-side then re-enabling client-side breaks button postback
I have a tabbed container and a button (not in the container) on a page. If the first tab is selecte
Whats wrong with my query?
I am trying to get this query to show the appropriate ticked vehicle roof height, unless no boxs are