Good Morning,
I have a script that is working just fine as it stands, thanks to ya'll :) I wanted to make a change to it but am having trouble making this change work. The scripts says to "select * from my databases", using "Where" three data inputs. This tells me that I should be able to echo anything from the database because of the "select *". However, the only thinks I can display are the 3 data inputs. Here is my code:
<?php
include ("connect.php");
//what data to query
$lname=$_POST['lname'];
$fname=$_POST['fname'];
$dob=$_POST['dob'];
//Select the query from the database
$query= "select * from voter where lname='$lname' AND fname='$fname' AND dob='$dob'";
//get results
$result=mysql_query($query);
$num_results = mysql_num_rows($result);
//set response if data received, else show no data
if($num_results > 0 ){
echo "<p>",$lname, ", ",$fname, ", ",$dob;
} else {
echo "<br /><p>","Your record was not found.<br /><br /> Please contact our office at xxx-xxx-xxxx for assistance.";
}
?>
If I add an additional data type to my echo (i.e., $reg_num) i get a blank screen. It seems to not want me to see any other data that is in my table other than the three mentioned above (lname, fname, dob). How do I tell it that i want to display more data than what is being shown? I tried adding a line to lines 4 - 6 such as $reg_num=$_POST; but this did not work. Please point in the right direction. Thank you.