| 
	
 | 
 Posted by Akhenaten on 05/19/07 14:02 
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($qid,$userid) 
  { 
include "db.inc.php"; 
$qstatus = mysql_query("SELECT status FROM `questions` WHERE `qid` = 
'$qid'", $db); 
$query1 = mysql_fetch_array($qstatus); 
// Query 2 and 1 
$result = "SELECT `a_uid` FROM `answers` WHERE `qid` = '$qid'"; 
$query = mysql_query($result, $db); 
while ($item = mysql_fetch_array($query)) { 
if (in_array($userid,$item)) { 
echo "<br><br>CANT GO HERE"; 
} 
if ( $query1['status'] = '1'){ 
echo "<br><br><a href='apage.php?qid=$qid'>GO HERE</a>"; 
} 
} 
 
************************
 
  
Navigation:
[Reply to this message] 
 |