Hi everyone,
I have a little problem.
Here is the structure
main.php
main.inc
connections.inc
here is the code
[code=php]
$conn = odbc_connect($database,$user,$password); //connect to database
$queryd=”SELECT distinct DeptName, DeptAbrev, DeptRecordID FROM DeptNames
order by DeptName”;
$resultd=odbc_exec($conn,$queryd);
$numd=odbc_num_rows($resultd);
//———–wont run this one—————
$queryt=”SELECT distinct Title, TitleCode, Dept FROM JobTitle
where TitleCode <> ”
order by Dept, Title”;
$resultt=odbc_exec($conn,$queryt);
$num=odbc_num_rows($resultt);
Now if I try to run another Query using the same connection “$conn” it gives me a warning
[code=html]
Warning: odbc_num_rows() expects parameter 1 to be resource
so it runs the first query with $conn but none of the others on the same page.
if I re-add the $conn in-front of the 2nd query, it will run.
Any suggestions?
Thank
Nat