Ahh - dont worry about this post ... :)

AndrewH


----- Original Message -----
From: "Andrew Halliday" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Monday, March 05, 2001 10:51 AM
Subject: [PHP] Why doesnt pass-by-value work?


> When I call this function:
>
>    function getColumnName($col)
>    {
>       if ($col > 0 && $col < pg_numfields($this->lastResultSet))
>          return pg_fieldname($this->lastResultSet,$col);
>       else
>          return null;
>    }
>
>
> It returns null all the time !
> The condition is NOT the problem ... Ive tested that with:
>
>    function getColumnName($col)
>    {
>          return pg_fieldname($this->lastResultSet,$col);
>       if ($col > 0 && $col < pg_numfields($this->lastResultSet))
>          return pg_fieldname($this->lastResultSet,$col);
>       else
>          return null;
>    }
>
> And it still returns null.
>
> If I do this:
>
>    function getColumnName($col)
>    {
>          echo pg_fieldname($this->lastResultSet,$col);
>          return pg_fieldname($this->lastResultSet,$col);
>       if ($col > 0 && $col < pg_numfields($this->lastResultSet))
>          return pg_fieldname($this->lastResultSet,$col);
>       else
>          return null;
>    }
>
> I do get the correct result printed to the browser ...
> So what the HELL is going on?   Dont tell me that pass by reference doesnt
> work with pg_* functions?
> Just to test this, I did this:
>
>    function getColumnName($col)
>    {
>          $test = pg_fieldname($this->lastResultSet,$col);
>          return $test;
>       if ($col > 0 && $col < pg_numfields($this->lastResultSet))
>          return pg_fieldname($this->lastResultSet,$col);
>       else
>          return null;
>    }
>
>
> This made no difference ... WHAT AM I DOING WRONG?!
>
> AndrewH
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> To contact the list administrators, e-mail: [EMAIL PROTECTED]
>


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]

Reply via email to