Forum Moderators: coopster
<?
$key = $HTTP_GET_VARS['key'];
require("POC_connect.php");
$Link = mysql_pconnect($Host, $User, $Password);
if (! $Link)
die("Couldn't connect to MYSQL");
mysql_select_db($DBName, $Link);
$Query = "SELECT * FROM poc WHERE POCID = " . $key;
$Result = mysql_query($Query, $Link) or die(mysql_error());
while($Row = mysql_fetch_assoc($Result));
$ProviderID = $Row['ProviderID'];
$MR = $Row['MR'];
$UPIN = $Row['UPIN'];
$Query2 = "SELECT * FROM patientdata WHERE MR = '" . $MR . "'";
$Result2 = mysql_query($Query2, $Link) or die(mysql_error());
while($Row2 = mysql_fetch_assoc($Result2));
$Last = $Row2['Last'];
$First = $Row2['First'];
$MI = $Row2['MI'];
$HCNum = $Row2['HCNum'];
$SOC = $Row2['SOC'];
?>
Are you not receiving any error messages? Just not data returned.
Could it be in this line, that it is not actually passing the value $key to the sql statement.
$Query = "SELECT * FROM poc WHERE POCID = " . $key;
I think that it might be closing after POCID = "
Try, somewhere, echo'ing the value of $Query to your page, and see if your sql statement is as it should be, ie: including the $key value.
Let us know,
wruk999
while loop. I notice you are using while [php.net], but you aren't actually looping. If you only intend to receive one row back, don't use while, otherwise, finish processing your loop... You currently have...
while($Row = mysql_fetch_assoc($Result));
$Row = mysql_fetch_assoc($Result);
Another useful debugging tool is the network sniffer. This tool is not for the faint hearted. It requires extensive network protocol knowledge as well as some skill in the operation of the software or device depending on what you choose or have access to. Data General's sniffer (a dedicated device -- hardware and software, tcpdump or Ethereal (both software programs running on Unix or Windows) are examples of this type of tool.
By trapping whole packets you may be able to see what is being transmitted. Beware what is not decoded as a particular protocol, or ascii is often decoded as Hex. I have included this information in case you are familar with network protocol detail and have done some sniffing. If you are not and would like to know, it is a LAN manager tool often used in network trouble shooting.