Re: Curious code behavior inside/outside function

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



From: "Karen Resplendo" <karenresplendo@yahoo.com>


> 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"
[snip]
> ****************************
> This doesn't work:
>
> function isValidPWS($pws)
>  {
> $data=odbc_do($connectionSDWIS,"EXEC sp_PWSExists '$pws'");

Scope issue. $connectionSDWIS is not defined within your function. Either
pass it to the function or make it global.

---John Holmes...

-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [PHP Users]     [Postgresql Discussion]     [Kernel Newbies]     [Postgresql]     [Yosemite News]

  Powered by Linux