Ok. I have change my function to use the MIN() and MAX() functions, and I am getting results, just not what I expceted.
All of my code parses, and everything works just fine, except the only thing that shows up in my drop down is RESO.
Here is my new function:
function yearSelect($CompanyID){
include 'db-customer.php';
$custIDfinance = $CompanyID . "Finance";
$old = mysql_query("SELECT MIN(Date) FROM $custIDfinance") or die(mysql_error());
$new = mysql_query("SELECT MAX(Date) From $custIDfinance") or die(mysql_error());
$old = substr($old, 0, 4);
$new = substr($new, 0, 4);
$baseyear = $old;
while ($baseyear <= $new){
echo "<option value=$baseyear>$baseyear</option>";
$baseyear = $baseyear +1;
}
}
Any help would be appreciated!
I commented out the "substr" statements to see what RESO was supposed to be:
That changed my output to:
<option value=Resource id #6>Resource id #6</option>
<option value=7>7</option>
The data I have under the Date column in this table is:
2007-11-02
2007-10-30
2007-10-30
2007-10-30
2007-10-30
2007-10-30
2007-10-29
2007-10-23
2007-10-22
Thanks,
Johnie Karr