You are here: Missing element in array?! « PHP Programming Language « IT news, forums, messages
Missing element in array?!

Posted by Akhenaten on 05/20/07 22:38

I have the following query I run to pull some data from the db. The
sql (when run on the db) returns 2 elements. However, if I var dump my
variable ($aidlook) then the first element in the array does not show
up.

$getaid = mysql_query("SELECT a_uid FROM `answers` WHERE `qid` =
$qid", $db);
$aidlook = mysql_fetch_array($getaid,MYSQL_NUM);

Doing a var dump returns: array(1) { [0]=> string(1) "4" }

I should be getting 2 elements (4 and 5).

I am totally baffled. code as follows:

*********************
if (!is_array($aidlook)) $aidlook = array($aidlook); // Check for the
existence of the array in case of null returns

if (!in_array($userid,$aidlook)) // Look for our element which in
this case is "5"
{
if ($qstatus === 1) // Do a status check
{
}

answer_box($qid,$answ); // additional function being run

} else
{
echo "Your Text Here";

}
}


../JLK

 

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

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