|
Posted by Akhenaten on 05/18/07 19:45
> function respond_check($qid,$username)
> {
> include "db.inc.php";
> $postchk2 = mysql_query("SELECT username FROM `answers` , `users` WHERE
> `qid` = $qid AND `a_uid` = `userid` AND `username` = '$username' LIMIT 0,
> 30",$db);
> if (mysql_num_rows($postchk2) > 0)
> {
> return TRUE;
> }
>
> return FALSE;
>
> }
>
> This function should return true if the user is found and false if not. Note
> that I added
>
> AND `username` = '$username'
>
> This is what your tryign to get returned but you can have sql do the work
> for you. It will only return the results where that is true but ofcourse
> thats all you care about anyways. Technically if its something like a user
> login you might want to test for more than one but in a well setup system
> there shouldn't be any more than 1. You'll also still needt o make sure that
> $postchk2 has a valid result in it.
>
> Jon
I copied your function verbatim Jon (thx for the sql advice by the
way). Unfortunately, I am unable to pull the data (TRUE or FALSE) from
the function - almost like it's not even executing. Any thoughts how I
can test why the function is not being called?
Navigation:
[Reply to this message]
|