For Programmers: Free Programming Magazines  


Home > Archive > PHP DB > February 2007 > Re: [PHP-DB] IF statement in WHILE statement









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author Re: [PHP-DB] IF statement in WHILE statement
Chris

2007-02-14, 3:58 am

Matthew Ferry wrote:
> Hello Everyone,
>
> Got another simple problem here....
>
> I am trying to do a if statement inside a while (mysql_fetch_array)
>
>
>
> Here is my code:
>
> if ($link = mysql_tech_array($links)) {
>
>
>
> do {
>
> if ($_GET['page'] = "$link[file]") {


You're assigning $_GET['page'] to whatever is in $link['file'].

It should be '==' not '=' to do a comparison.

--
Postgresql & php tutorials
http://www.designmagick.com/
Matthew Ferry

2007-02-14, 3:58 am

Thanks Chris...

added the extra =

and its working fine...

Have a nice day everyone!!!!

Matt
----- Original Message -----
From: "Chris" <dmagick@gmail.com>
To: "Matthew Ferry" <mferry@retailautomation.biz>
Cc: <php-db@lists.php.net>
Sent: Tuesday, February 13, 2007 11:53 PM
Subject: Re: [PHP-DB] IF statement in WHILE statement


> Matthew Ferry wrote:
>
> You're assigning $_GET['page'] to whatever is in $link['file'].
>
> It should be '==' not '=' to do a comparison.
>
> --
> Postgresql & php tutorials
> http://www.designmagick.com/
>

Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2008 codecomments.com