You are here: DysFunctional « PHP Programming Language « IT news, forums, messages
DysFunctional

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]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация