Reply to question about processing MySQL query result

Your name:

Reply:


Posted by vito on 06/22/06 05:55

after executing the query, say it returns 1000 results.

if i just want to do some sampling and like to have a look on 4 of them,
how can i refer to these 4 random records out of 1000? i'm working on
processing the result of $res_array which has 1000 records.

query = select * from test;

result = mysql_query(query);

records1000 = db_result_to_array($result);
//how to select/remove records1000 to get say, records4?


function db_result_to_array($result) {
$res_array = array();
for ($count=0; $row = $result->fetch_assoc(); $count++) {
$res_array[$count] = $row;
}
return $res_array;
}

[Back to original 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

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