View Single Post
  #10 (permalink)  
Old 08-21-08, 11:17 AM
snakeob snakeob is offline
Newbie Coder
 
Join Date: Jun 2008
Posts: 42
Thanks: 0
Thanked 0 Times in 0 Posts
i took the line completely out and it querys i realized it must be querying from my first page which follows,

PHP Code:

<?php


##                                ##
#this part connects to the database#
##                                ##

$DB "jakestest";

$link mysql_connect("localhost","root","")
        or die(
"cant connect");

mysql_select_db($DB);

##                                                           ## 
#this part is a combonation of bill, month and year selectionn#
##                                                           ## 

echo "<h2>Please select the client, month and year that you  would like to generate a bill for<h2>";
echo 
"<form action='processform.php' method='POST'>";
echo 
"<select name=number>\n";
$result mysql_query("SELECT DISTINCT account FROM biller");
    while (
$row mysql_fetch_array($result))
{
    echo 
"<option value='{$row['account']}'>";
    echo 
$row['account']."\n";
}
echo 
"</select>";

echo 
"\t";

echo 
"<select name=month>\n";
$result2 mysql_query("SELECT DISTINCT months FROM months");
while ( 
$row mysql_fetch_array($result2))
{
        echo 
"<option value='{$row['months']}'>";
        echo 
$row['months'] ."\n";
}
echo 
"</select>";

echo 
"\t";

echo 
"<select name=year>\n";
$result3 mysql_query("SELECT DISTINCT years FROM years");
while ( 
$row mysql_fetch_array($result3))
{
        echo 
"<option value='{$row['years']}'>";
    echo 
$row['years']."\n";
}
echo 
"</select>";

echo 
"&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp";
echo 
"\n<input type='submit' value= 'Submit'>";
echo 
"\n</form>\n";
echo 
"</option>"
?>
</center>
</body>
</html>
because im querying from a different table to make the month and year dropdown list clean, but it is not getting from my big table, how do i combine them now??
Reply With Quote