|
Posted by ZeldorBlat on 05/18/07 15:12
On May 18, 10:47 am, Akhenaten <jonko...@gmail.com> wrote:
> On May 18, 9:18 am, Akhenaten <jonko...@gmail.com> wrote:
>
>
>
> > For whatever reason I can't get my return value to pass outside of the
> > function I've created. I've tested all the responses within the
> > function so I know the data is there and the sql query is valid. Am I
> > missing something to get it passed outside the function?
>
> > ******************************
>
> > function respond_check($qid,$username)
> > {
> > include "db.inc.php";
> > $postchk2 = mysql_query("SELECT username FROM `answers` , `users`
> > WHERE `qid` = $qid AND `a_uid` = `userid` LIMIT 0, 30",$db);
> > while ($userx=mysql_fetch_array($postchk2))
> > {
> > if (in_array($username,$userx)) {
> > $freturn = 7;
> > return $freturn;
>
> > }
> > }
> > }
>
> > ******************************
>
> Disregard -- it's always the simple mistakes that make you pound your
> head. I failed to make $freturn global.
The whole point of returning it from the function is so you don't have
to make it a global.
[Back to original message]
|