Somehow hours of typing have blinded me. Basically I'm trying to come
up with an "If not this then this" type scenario but (as you can
probably see) I am not getting what I want. All variables are good
(queries, etc.)
I want either "CANT GO HERE" or "GO HERE" but instead I end up with
"CAN'T GO HERE"
"GO HERE"
"GO HERE"
"GO HERE"
Of course I know the while loop is giving me the reiterations but I'm
not sure why I'm getting both sets back instead of one. Thoughts
[other than giving up PHP] ??
*************** ************
// This Function is KILLING ME
function didi_answer($qi d,$userid)
{
include "db.inc.php ";
$qstatus = mysql_query("SE LECT status FROM `questions` WHERE `qid` =
'$qid'", $db);
$query1 = mysql_fetch_arr ay($qstatus);
// Query 2 and 1
$result = "SELECT `a_uid` FROM `answers` WHERE `qid` = '$qid'";
$query = mysql_query($re sult, $db);
while ($item = mysql_fetch_arr ay($query)) {
if (in_array($user id,$item)) {
echo "<br><br>CA NT GO HERE";
}
if ( $query1['status'] = '1'){
echo "<br><br><a href='apage.php ?qid=$qid'>GO HERE</a>";
}
}
*************** *********
up with an "If not this then this" type scenario but (as you can
probably see) I am not getting what I want. All variables are good
(queries, etc.)
I want either "CANT GO HERE" or "GO HERE" but instead I end up with
"CAN'T GO HERE"
"GO HERE"
"GO HERE"
"GO HERE"
Of course I know the while loop is giving me the reiterations but I'm
not sure why I'm getting both sets back instead of one. Thoughts
[other than giving up PHP] ??
*************** ************
// This Function is KILLING ME
function didi_answer($qi d,$userid)
{
include "db.inc.php ";
$qstatus = mysql_query("SE LECT status FROM `questions` WHERE `qid` =
'$qid'", $db);
$query1 = mysql_fetch_arr ay($qstatus);
// Query 2 and 1
$result = "SELECT `a_uid` FROM `answers` WHERE `qid` = '$qid'";
$query = mysql_query($re sult, $db);
while ($item = mysql_fetch_arr ay($query)) {
if (in_array($user id,$item)) {
echo "<br><br>CA NT GO HERE";
}
if ( $query1['status'] = '1'){
echo "<br><br><a href='apage.php ?qid=$qid'>GO HERE</a>";
}
}
*************** *********
Comment