Well I am having so much fun....
Here is the newly created code which lets you select the title AFTER you select the date:
$author = "Sharif Tanvir Karim";
if (!isSet($_POST['article_date'])) {
echo ("<center>Please Select The DATE Of The Article To Be Edited:\n");
echo ("<form name=\"select_date\" action=\"updater2.php\" method=\"post\">\n");
echo ("<select name=\"article_date\" onChange=\"document.select_date.submit();\"> \n");
$query = mysql_query ("SELECT date_FORMAT(date,'%m/%d/%Y') AS date FROM news WHERE author='$author' ORDER BY date ASC");
while ($row = mysql_fetch_array($query))
{
$date = $row["date"];
//List the options for the list field
echo "<option>$date</option>\n";
}
echo ("</select>\n");
echo ("</form>\n");
echo ("</center>\n");
}
else
{
if(isSet($_POST['article_date'])){
// This executes if the user selected a date
$sql_date = $article_date;
echo $sql_date;
echo ("<center><u>These are the articles available for the date:</u><br> ");
echo ("<b>$article_date</b></center>");
echo ("<center>Please Select The <b><u>TITLE</u></b> Of The Article To Be Edited:\n");
echo ("<form name=\"select_title\" action=\"updater2.php\" method=\"post\">\n");
echo ("<select name=\"article_title\" onChange=\"document.select_title.submit();\">\n");
$query = mysql_query ("SELECT title FROM news WHERE author = '$author' AND date = '2003-05-18 12:14:47' ORDER BY title ASC");
while ($row = mysql_fetch_array($query))
{
$article = $row["title"];
//List the options for the list field
echo "<option>$article</option>\n";
}
echo ("</select>\n");
echo ("</form>\n");
echo ("</center>\n");
}
}
Now here is my problem:
You see on the IF, inside the ELSE, in the sql query I have AND date = ''2003-05-18 12:14:47'. '2003-05-18 12:14:47' is a timestamp of a article. I figured out why it wasn't working.
When you go to select the date, the sql query formats it to ONLY select the date as m/d/y and not the time. This is where it screws me because, I HAVE to do this in order for the date to display as m/d/y. I don't know any other ways to get it to show up as m/d/y without having to format it in the sql query itself. So please help me with this.
Next, as I stated in one of my earlier posts:
in the database there are currently 6 rows, with dates: 05/18/03 three times, 05/19/03 two times and when it returns the dates, it returns the dates the amount of time it exists... it just doesn't make sense with having the ability to select the same date more than once so how can I display one date only once.
PLEASE PLEASE HELP, I'm so close to being done - I can taste it.