$sql = mysql_query("select id, name, code from users");
$userinfo = array();
while ($row_user = mysql_fetch_assoc($sql))
$userinfo[] = $row_user;
Získáte tak $userinfo
jako pole s následující strukturou:
[
[id => 1, name => 'gorge', code => '2123'],
[id => 2, name => 'flix', code => 'ksd02'],
[id => 3, name => 'jasmen', code => 'skaod2']
]
Pokud chcete data odeslat:
foreach ($userinfo as $user) {
echo "Id: {$user[id]}<br />"
. "Name: {$user[name]}<br />"
. "Code: {$user[code]}<br /><br />";
}