i have 2 tables medicalhistory and patient in medicalhistory i have fields name DoctorId and PatientId and in patient ihave PatientId, FirstName,MiddleName,LastName
as of now my query is this it only filter one table and the patientid from medicalhistory.
$dids = $_SESSION["DoctorId"];
if(isset($_POST["btnsrch"])&& ($_POST["textbox"]!="")){
$pid = $_POST["textbox"];
$pid= mysqli_real_escape_string($_POST["textbox"]);
$query2= mysqli_query($link,"Select DISTINCT PatientId from medicalhistory where DoctorId='". $dids ."' or PatientId='". $pid ."'" );
}
my problem is how will i query the FirstName MiddleName and LastName but it will query only the name that have records on that doctor in medicalhistory ?
AND
. Post code in your question its not readable in a comment – Mike Miller