I have the following query that is using a variable from a previous page (User Input AS $ss_num):
$query1 = "SELECT Emp_hed.emph_emp_code
FROM Emp_hed
WHERE ((Emp_hed.emph_ssc_nbr)='$ss_num')";
$result1 = odbc_exec($connect, $query1);
The results will be a SINGLE record, Employee#. I then want to use the results to execute an additional query:
$query2 = "SELECT whatever...
FROM table...
WHERE field='$result1'";
I am not returning any results from my second query??? I can echo $result1 and it is getting the data but when used in the second query, it seems as if it is empty???
Thanks in advance for any help.
$query1 = "SELECT Emp_hed.emph_emp_code
FROM Emp_hed
WHERE ((Emp_hed.emph_ssc_nbr)='$ss_num')";
$result1 = odbc_exec($connect, $query1);
The results will be a SINGLE record, Employee#. I then want to use the results to execute an additional query:
$query2 = "SELECT whatever...
FROM table...
WHERE field='$result1'";
I am not returning any results from my second query??? I can echo $result1 and it is getting the data but when used in the second query, it seems as if it is empty???
Thanks in advance for any help.