Hi,
I have a problem with a function inside an include file.
The include file:
<?php
$connection = mysql_connect("localhost", "testmanager", "testmgr") or die
("Unable to connect!");
function getstat($statno) {
$statquery="select StatusDescr from tblTestingStatus where StatusNo=$statno";
$res=mysql_db_query("TestManagement",$statquery,$connection)
or die (mysql_error());
$data=$mysql_fetch_array($stat);
$var=$data[StatusDescr];
echo "$var";
}
?>
From another file I call the function:
getstat($statno)
If I put the contents of the function directly into the file that calls the function it works, with no problems. However, if I call the function I get the following error:
Warning: mysql_db_query(): supplied argument is not a valid MySQL-Link resource in /usr0/html/testmanager/reports/functions.inc.php on line 8
Any help would be appreciated.