ID:               25247
 Updated by:       [EMAIL PROTECTED]
 Reported By:      jeroen at kesh dot nl
-Status:           Feedback
+Status:           No Feedback
 Bug Type:         Arrays related
 Operating System: Windows 2000 Server
 PHP Version:      4.3.3
 New Comment:

No feedback was provided. The bug is being suspended because
we assume that you are no longer experiencing the problem.
If this is not the case and you are able to provide the
information that was requested earlier, please do so and
change the status of the bug back to "Open". Thank you.




Previous Comments:
------------------------------------------------------------------------

[2003-08-26 07:17:09] [EMAIL PROTECTED]

Try calling srand(time()); before the shuffle.

------------------------------------------------------------------------

[2003-08-26 05:44:58] jeroen at kesh dot nl

Description:
------------
I pick the first two products out of the shuffled array for random
productviews on a page. I use 3 or more products.
With PHP 4.3.2 it works nice (every refresh another two products). With
PHP 4.3.3 it doesn't seem to work. Every time the same products.

Same PHP.INI file as 4.3.2 (which worked fine).

Reproduce code:
---------------
$ads = array(); 
while($product = mysql_fetch_array($arts)) {    
  $ads[] = $product; 
} 
                
shuffle($ads);

$prod = $ads[0];
echo ($prod[name]);

$prod = $ads[1];
echo ($prod[name]);

Expected result:
----------------
The first two array-records are other products every time at refresh.

Actual result:
--------------
The first two array-records are the same products each refresh.


------------------------------------------------------------------------


-- 
Edit this bug report at http://bugs.php.net/?id=25247&edit=1

Reply via email to