After getting the results back from the query, I count the rows and put into $rowcount, echo out and return say three records. I then want to populate a dropdown with the results. Just isn't happening for some reason. Out of the database is returns date format like 2005-03-07, I want the dropdown to reflect 03/07/2005. Can someone see what I have incorrect? Thanks
$myquery4 = "SELECT direct_deposit.checkdate AS TRANSACTION
FROM
human_resources.direct_deposit
WHERE
direct_deposit.ssn = '$ss_num'
ORDER BY direct_deposit.checkdate DESC";
$myresult4 = mysql_query ($myquery4, $link);
if (!$myresult4)
echo "Direct Deposit Query Failed.";
$rowcount = mysql_num_rows($myresult4);
{
if ($rowcount > 0){
echo "<select name='directdeposit'>\n";
while ($ddrows = mysql_fetch_row($myresult4)) {
$ddperend = mysql_result ($myresult4,'TRANSACTION');
$ddperend1 = explode("-", $ddperend);
$mod_ddperend = $ddperend1[1] . "/" . $ddperend1[2] . "/" . $ddperend1[0];
$ddout = $mod_ddperend;
echo '<option value="'.$ddout.'">'.$ddout.'</option>'."\n";
}
echo "</select>\n";
}
}
$myquery4 = "SELECT direct_deposit.checkdate AS TRANSACTION
FROM
human_resources.direct_deposit
WHERE
direct_deposit.ssn = '$ss_num'
ORDER BY direct_deposit.checkdate DESC";
$myresult4 = mysql_query ($myquery4, $link);
if (!$myresult4)
echo "Direct Deposit Query Failed.";
$rowcount = mysql_num_rows($myresult4);
{
if ($rowcount > 0){
echo "<select name='directdeposit'>\n";
while ($ddrows = mysql_fetch_row($myresult4)) {
$ddperend = mysql_result ($myresult4,'TRANSACTION');
$ddperend1 = explode("-", $ddperend);
$mod_ddperend = $ddperend1[1] . "/" . $ddperend1[2] . "/" . $ddperend1[0];
$ddout = $mod_ddperend;
echo '<option value="'.$ddout.'">'.$ddout.'</option>'."\n";
}
echo "</select>\n";
}
}