I can't get odbc call to work inside of a function. It works on the outside, then I 
pass the recordset and fieldname to the function to use the data. I would like to just 
have the whole odbc stuff inside the function. Am I missing something obvious? This is 
the error I get for the odbc_do line:
"Supplied argument is not a valid ODBC-Link resource"
**************************
This works:
$data=odbc_do($connectionSDWIS,"EXEC sp_PWSExists '$pws'");
 
if (isValidPWS($data))
{
//do something here
}
else
{
//do something here
}
function isValidPWS($data)
 {
 $lookforthispws= odbc_result($data,1);
  if ($lookforthispws=="YES")
   {
    return true;
   }
 }
****************************
This doesn't work:

function isValidPWS($pws)
 {
$data=odbc_do($connectionSDWIS,"EXEC sp_PWSExists '$pws'");
 $lookforthispws= odbc_result($data,1);
  if ($lookforthispws=="YES")
   {
    return true;
   }
 }


---------------------------------
Do you Yahoo!?
Yahoo! SiteBuilder - Free, easy-to-use web site design software

Reply via email to