I have this function to connect to our I5
////////////////////////
// executeReadSQL
////////////////////////
function executeReadSQL($sql){
$conn = odbc_connect('I5','USER','PASSWORD');
if (!$conn)
{
exit("Connection failed ! " . $conn);
}
$rs = odbc_exec($conn,$sql);
if (!$rs)
{
exit("Error in sql " . $sql);
}
return($rs);
}
Problem here is I think I'm not closing the odbc connection with the odbc_close connection, will this lead to problems ?
How can I close the connection and still use this function ?
Do I need to use a class instead ?