PHP/HTML/MySQL issue HELP???
Posted: Thu Jul 02, 2009 4:21 pm
i am quite sure this has been asked before... but me being the moron i am, i can't find my exact issue... so here it goes.
what i am trying to do is use an HTML "<SELECT>" that grabs the dates from a specific db table in MySQL. so... here is the code that i have currently...
and while that looks right to me... i am sure i am doing something wrong... BECAUSE... the select box in my html page shows nothing in there...
BUT!!!!!!!!! and this is a big BUT!!!!!!!
when i do a "View Source" on the HTML page, this is what i get....
SOOOO..... my database part is working... the fetching is working... as you can see it is producing the correct HTML as far as i can find on the web.... but still the "SELECT" box shows nothing in it....
any suggestions?
thanks in advance for your help...
DagasSiren...
what i am trying to do is use an HTML "<SELECT>" that grabs the dates from a specific db table in MySQL. so... here is the code that i have currently...
Code: Select all
/*********************************************************
** THIS SECTION TO RETRIEVE DATE AND FILL OPTIONS BOX **
*********************************************************/
echo "<HTML>\n<BODY>\n";
echo "<TABLE align=\"center\" width=\"75%\" border=\"3\">\n<TR>\n";
echo " <TD align=\"right\" width=\"50%\">PLEASE SELECT DATE: </TD>\n";
echo " <TD align=\"left\" width=\"50%\">\n";
echo " <SELECT name=\"datedropdown\" size=\"1\">\n";
$connect=mysql_connect('localhost',$us,$pa);
@mysql_select_db($db) or die("Unable to connect to requested Database...");
$date_query=("SELECT date FROM nondenom ORDER BY date asc");
$date_result=mysql_query($date_query) or die ("Unable to Make the Query:" . mysql_error() );
$row_num=mysql_numrows($date_result);
$a = 0;
while ( $a < $row_num )
{
$row_date=mysql_fetch_assoc($date_result);
$showdate = $row_date['date'];
$dateid = $a;
echo "<OPTOIN value=\"" . $dateid . "\">";
echo $showdate;
echo "\n";
$a++;
}
echo "</OPTION>\n";
mysql_close();
echo "</SELECT>\n</TD>\n</TR>\n</TABLE>\n\n</BODY>\n</HTML>";
BUT!!!!!!!!! and this is a big BUT!!!!!!!
when i do a "View Source" on the HTML page, this is what i get....
Code: Select all
<HTML>
<BODY>
<TABLE align="center" width="75%" border="3">
<TR>
<TD align="right" width="50%">PLEASE SELECT DATE: </TD>
<TD align="left" width="50%">
<SELECT name="datedropdown" size="1">
<OPTOIN value="0">2009-07-01
<OPTOIN value="1">2009-07-02
</OPTION>
</SELECT>
</TD>
</TR>
</TABLE>
</BODY>
</HTML>
any suggestions?
thanks in advance for your help...
DagasSiren...