You are here: Re: Foreach displaying data twice « PHP Programming Language « IT news, forums, messages
Re: Foreach displaying data twice

Posted by Schraalhans Keukenmeester on 06/01/07 15:56

At Fri, 01 Jun 2007 07:59:11 -0700, Akhenaten let h(is|er) monkeys type:

> I must be missing something rather obvious. I have the following
> snippet of code that echo's my result twice when it should be echoing
> just once (only one element in the array). What am I overlooking?
>
>
> ********************************
> $OpenQ = mysql_query("SELECT column FROM table WHERE q_uid =
> $_SESSION[userid] AND status = 1",$db); // SQL query on DB returns 1
> result

Rami has answered your question. I just wondered whether:
a) userid is a defined constant. If not, it should be in quotes.
b) $_SESSION[userid] (and q_uid) is a numerical or a string. If the
latter, it should be in quotes.

Just my 2cts.

Sh.

 

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

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