I have a function that makes a odbc connection and returns the recordset, only problem ( not sure if it is a problem ) is that I can not close the connection, if I do it in the function I lose my recordset, is there another way to do this ?
With a class ?
Could this lead to a problem if I don't close the connections ?
This is the code :
function executeReadSQL($sql){
$conn = odbc_connect('SERVER','USER','PASWORD');
if (!$conn)
{
exit("Connection failed ! " . $conn);
}
$rs = odbc_exec($conn,$sql);
if (!$rs)
{
exit("Error in sql " . $sql);
}
return($rs);
}