Re: function returns no value

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

 



On Sun, Apr 20, 2008 at 4:51 PM, Ali Reza Sajedi <arsajedi@xxxxxxxxxxxxx>
wrote:

> Hello,
>
> with the following call I try to print a string out of DB
>
> echo $allg->translate($db, $lang, 14, "auth/authCallback", 4);
>
> function translate () should do a DB querry and returns the requested
> string. Although the querry yields a positive result, the function returns
> no value.
>
> Here is the function:
>
> function translate ($db, $lang, $MaiKey, $page, $pid) {
>
>  $statement = "SELECT fa FROM language WHERE MaiKey='$MaiKey' AND
> page='$page' AND pid='$pid'";
>
>  $result = $db->Execute($statement);
>
>  if ($result=== false) die();
>
>  return $result->fields[0];
> }
>
> Could anybody see what is going wrong here?


its hard to say, since we cant see whats going on inside the Execute
function...  you might try to add a
var_dump($result);
directly after the call to Execute, just for debugging purposes, then remove
it once you know whats going on.

-nathan

[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux