naprej
  • css
  • firefox
  • html
  • javascript
  • mootools
  • mysql
  • php
  • web
  • xubuntu
23/08/2011

PHP/MySQL convert while statements to foreach

$select = array();
while($row=mysql_fetch_array($result)) {   
    $select[]=$row;
}

foreach ($select AS $key => $value) { // your code }

Related Posts

 Changing MySQL default character sets (latin) to UTF-8, MySQL: what data type to use for hashed password field and what length, MySQL Data Types

php
  • Copyright © 2009 - 2022 naprej.com