This is a payroll website that i am building, the select box is loading correctly however the textarea is loading blank. there are no error messages being displayed. i have tried many variations with this and nothing has worked.
<?php
$result = mysql_query("SELECT fullname FROM employee");
while ($row = mysql_fetch_array($result)) {
echo "<option>".$row['fullname']."</option><br>";
};
?>
<option>New Employee</option>
</select>
<br/>
<br/>
<br/>
<br/>
<textarea name="txtempinfo" rows="5" cols="15" id="txtempinfo"/>
<?php
$tmpVar = $_POST['select1'];
$result = mysql_query("SELECT ssn, dob, add1, add2, phone, empid, position, hiredate, termdate, status, salary, driverslicense FROM employee WHERE fullname = '$tmpVar' ") or die(mysql_error());
while ($row = mysql_fetch_array($result)) {
echo "".$row['ssn']."|"."".$row['dob']."|"."".$row['add1']."|"."".$row['add2']."|".
"".$row['phone']."|"."".$row['empid']."|"."".$row['position']."|"."".$row['hiredate']."|".
"".$row['termdate']."|"."".$row['status']."|"."".$row['salary']."|"."".$row['driverslicense']."";
};
?>
</textarea>
i have tried changing the $tmpVar variable to $tmp_var, I have reversed all the quotes from single ' to double" and from double " to single '.
If I change
FROM employee WHERE fullname = '$tmpVar'
to
FROM employee WHERE fullname = 'John Smith'
then It correctly displays John Smiths details. i have also tried to change the query to count the rows and display that to see if was reading the database just not displaying the info but it displayed a 0, I have ran out of ideas. any help is greatly appreciated. And no John Smith is not a real person nor is the information loaded into the database. If you would like to see the code hosted you can go to redhammerconstruction.com , please excuse the lack of styling, i have dedicated all my time to fixing this coding error and not to appearance.