I have a query I am attempting that allows a manager to hover on an icon and see who the last assigned user to a patient was, I am nesting a loop inside a loop, it works but only on the first result... I have done this in the past and had it work fine but cant seem to see my mistake here.
the '102023' is just a known patient ID number, normall it would have the variable pulled from $r["firstquerycolumn"]
I am not sure what I am missing, maybe this isnt possible but it seems it should be. The result is the first row has the information is should.. the rest of the rows only show the hover div with the preset text in them.
I am baffled, I am sure its something stupidly easy, but I am not seeing it.
Thanks,
Mike
the '102023' is just a known patient ID number, normall it would have the variable pulled from $r["firstquerycolumn"]
Code:
<table cellpadding="0" cellspacing="0">
<tr>
<td class="header" style="border:solid black 1px;border-right:none;"><b>Patient</b></td>
<td style="border:solid black 1px;border-left:none;"><b> </b></td>
<td class="header" style="border:solid black 1px"><b>Chart#</b></td>
<td class="header" style="border:solid black 1px"><b>Alt. Chart#</b></td>
<td class="header" style="border:solid black 1px"><b>Sx Date</b></td>
<td class="header" style="border:solid black 1px"><b>Concern Date</b></td>
<td class="header" style="border:solid black 1px"><b>Concern Time</b></td>
<td class="header" style="border:solid black 1px"><b>PSA</b></td>
<td class="header" style="border:solid black 1px"><b>Assign To</b></td>
<td style="border:solid black 1px"> </td>
</tr>
<?
include '../dbcon/pcc_config.php';
include '../dbcon/pcc_opendb.php';
$color22 = "#B7DBEC";
$color11 = "#FFFFFF";
$row_count = 0;
// Start Main Query
$result = mysql_query("SELECT pcc_concerns.*, pcc_patient.*, pcc_patient_sx.* FROM pcc_concerns JOIN pcc_patient ON pcc_patient.pcc_patient_contact_id = pcc_concerns.pcc_concerns_contact_id JOIN pcc_patient_sx on pcc_patient_sx.pcc_patient_sx_id = pcc_concerns.pcc_concerns_sx_id WHERE pcc_concerns_assigned_status = '0'");
while($r=mysql_fetch_array($result))
{
variables here....
$row_color = ($row_count % 2) ? $color11 : $color22;
echo "<form name=\"" . $loader . "\" id=\"" . $loader . "\" action=\"\" method=\"post\" target=\"_self\">\n".
"<tr bgcolor=\"$row_color\">\n".
"<td style=\"border:solid black 1px; border-right:none\"> " . $pcc_patient_lname . ", " . $pcc_patient_fname . " </td>\n".
"<td style=\"border:solid black 1px; border-left:none\"><img src=\"../images/info.gif\" onMouseOver=\"showTip('ttip" . $loader. "ttip');\" onMouseOut=\"hideTip('ttip" . $loader. "ttip');\" onMouseMove=\"positionElement('ttip" . $loader. "ttip');\"></td>\n".
"<div id=\"ttip" . $loader. "ttip\" class=\"tooltip\"><font color=\"#000000\" size=\"2\">Latest PA Info: <br /><br />";
// Start secondary query
$inner_result = mysql_query("SELECT pcc_concerns_date, pcc_concerns_prac_int FROM pcc_concerns WHERE pcc_concerns_contact_id = '102023' ORDER BY pcc_concerns_date desc");
while($ir=mysql_fetch_array($inner_result))
{
echo $ir["pcc_concerns_date"] . " " . $ir["pcc_concerns_prac_int"] . "<br />";
}
// End secondary query
// Continue Main Query
echo "</font></div>\n".
"<td style=\"border:solid black 1px\"><div align=\"center\"> " . $pcc_patient_sx_chart_id . " </div></td>\n" .
"<td style=\"border:solid black 1px\"><div align=\"center\"> " . $pcc_patient_sx_alt_chart_id . " </div></td>\n" .
"<td style=\"border:solid black 1px\"><div align=\"center\"> " . $pcc_patient_sx_sx_date_echo . " </div></td>\n" .
"<td style=\"border:solid black 1px\"><div align=\"center\"> " . $pcc_concerns_date_echo . " </div></td>\n" .
"<td style=\"border:solid black 1px\"><div align=\"center\"> " . $pcc_concerns_time . " </div></td>\n" .
"<td style=\"border:solid black 1px\"><div align=\"center\"> " . $pcc_patient_manager . " </div></td>\n" .
"<td style=\"border:solid black 1px\"><select name=\"pcc_concerns_prac_int\">\n<option value=\"\">Select</option>\n";
include 'grab_pa.php';
echo "</select></td>\n".
"<td style=\"border:solid black 1px\"><input type=\"button\" onClick=\"document.$pcc_patient_fname$pcc_patient_care_id$pcc_patient_contact_id$pcc_concerns_id$pcc_patient_fname.action='insert_assign_pa.php'; document.getElementById('" . $loader . "').submit();\" style=\"background-color:$row_color;\" value=\"Assign\"></td>\n".
"</tr><input type=\"hidden\" name=\"search_id\" value=\"$pcc_concerns_id\"></form>\n";
$row_count++;
}
include '../dbcon/pcc_closedb.php';
?>
</table>
I am not sure what I am missing, maybe this isnt possible but it seems it should be. The result is the first row has the information is should.. the rest of the rows only show the hover div with the preset text in them.
I am baffled, I am sure its something stupidly easy, but I am not seeing it.
Thanks,
Mike