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!!!!!
How to update this array?
I am saving a string that looks this: username1, username2, username3...into a single cell in a database table. I am doing this so that when I retrieve that string using normal methods, I can turn it
Refining of search Criteria
Dear FriendsI need a help, I have a search page which of cars related, which has different search criteria e.g. maker, model, color, displacement etc. when i give any search criteria and click the
MySQL query problem
When I try to run the following piece of code, I get this error:QuoteWarning: mysql_query(): supplied argument is not a valid MySQL-Link resource in /home/muskelmann098/public_html/build.php on line
Cannot Display Array from Select Statement + Login question
Hi,I'm new to PHP but so far so goog. I was assigend a project and I'm very close to completion. I have a site that logs you in, sets a cookie, and then what I would like to do is depending on the
Count on multidimensional array
Hi, i got an array as below:Array( => Array ( [2009-12-08] => 1 ) [1] => Array ( [2009-12-07] => 1 ) [2]
How to login with SAPCPIC userid
I have changed the Password for SAPCPIC in Development Server for 000,001 and 100 client.
Get last modified date of web page
Hai All, In php how can i get last modified date of a give web page . I have tried to get last modified from the header but for some pages the server of that webpage doesn't returns lastmodified
PHP loop
Okay so I have several "articles" stored in a mysql database and am attempting to echo those onto a PHP page.so on index.php I haveCode: <?php article_layout();?> (yes there is
how do i make a string??
hey guys,can someone please tell me how to put data from the glob function into a stringthanks
Allegro crashes when running load_bitmap. Why?
I can not get Allegro to load any BMP images. Here is a section of test code. The picture is in the working directory:BITMAP *my_pic; my_pic = load_bitmap("kirby.bmp", NULL); if(!my_pic)