Related to my previous question on searching through an array, I
discovered the issue. I have a session variable ($username) which I
can not call inside my functions. I can call it just fine outside the
function. Suggestions?
Also, is it an issue because my array returns a column with the same
name?
*************** *************
function respond_check($ qid)
{
include "db.inc.php ";
$postchk2 = mysql_query("SE LECT username FROM `answers` , `users`
WHERE `qid` = $qid AND `a_uid` = `userid` LIMIT 0,
30",$db);
while ($userx=mysql_f etch_array($pos tchk2))
{
if (in_array("$use rname",$userx)) {
echo "Got I finally Got ITT!!!!";
}
}
}
echo "$username is cool"; // This works here but not within the
function
*************** *************
discovered the issue. I have a session variable ($username) which I
can not call inside my functions. I can call it just fine outside the
function. Suggestions?
Also, is it an issue because my array returns a column with the same
name?
*************** *************
function respond_check($ qid)
{
include "db.inc.php ";
$postchk2 = mysql_query("SE LECT username FROM `answers` , `users`
WHERE `qid` = $qid AND `a_uid` = `userid` LIMIT 0,
30",$db);
while ($userx=mysql_f etch_array($pos tchk2))
{
if (in_array("$use rname",$userx)) {
echo "Got I finally Got ITT!!!!";
}
}
}
echo "$username is cool"; // This works here but not within the
function
*************** *************
Comment