RE: Problem with while

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



HI

Let me gives you more detail.The value that return by the fetch is something like this:

“5,6,25,  “ which I explode it in the while and then use foreach for get the numbers one by one  so I have to use foreach in the while.Does anybody has any idea on how can I stop conflicts of them?

 

Thanks all for their help

image002

         HNO

 

From: php-objects@xxxxxxxxxxxxxxx [mailto:php-objects@xxxxxxxxxxxxxxx] On Behalf Of parekh dhaval
Sent: November 30, 2009 4:58 PM
To: php-objects@xxxxxxxxxxxxxxx
Subject: Re:  Problem with while

 

  

Hi there,

Well i completely agree with rahul
you can use directly while loop for fetch each row from the database
then y u using for each inside may be both loop conflicts that's y loop didn't work 
if u just want run program anyhow then you can use while loop directly 

________________________________
From: rahul dongre <mady_dongre@xxxxxxxxxxx <mailto:mady_dongre%40yahoo.co.in> >
To: php-objects@xxxxxxxxxxxxxxx <mailto:php-objects%40yahoogroups.com> 
Sent: Mon, 30 November, 2009 1:28:04 PM
Subject: Re:  Problem with while

y r using foreach inside d while.u can use 
while($row = mysql_fetch_ object($rs) ){ $row->[your colom name];
}you can use like this plz ignore this if i am not interpreted ur problem properly .

Rahul Dongre
Software Engineer
Consagous Technologies Pvt. Ltd. 

--- On Mon, 30/11/09, hno <hno2005@gmail. com> wrote:

From: hno <hno2005@gmail. com>
Subject:  Problem with while
To: php-objects@ yahoogroups. com
Date: Monday, 30 November, 2009, 12:04 PM

HI

How can have a while and a foreach in it?

I have something like this:

While($row=mysqli_ fetch_assoc( $r)){

// code

Foreach($row[ 'key'] as $value){

//code

}

}

But the while loop run just one time and I'm sure it should run more than

one time and I know the problem is with the foreach .by the way,I can't

delete the foreach from the while because It works with each row from the

while loop.

Does anybody has any idea about it?

thanks

image002

HNO

[Non-text portions of this message have been removed]

The INTERNET now has a personality. YOURS! See your Yahoo! Homepage. http://in.yahoo. com/

[Non-text portions of this message have been removed]

The INTERNET now has a personality. YOURS! See your Yahoo! Homepage. http://in.yahoo.com/

[Non-text portions of this message have been removed]





[Non-text portions of this message have been removed]


[Index of Archives]     [PHP Home]     [PHP Users]     [PHP Soap]     [Kernel Newbies]     [Yosemite]     [Yosemite Campsites]

  Powered by Linux