Re: Re: HTML layout and arrays (WAS : Brain not working, helpneeded :-). .

From: Date: Mon, 29 Aug 2005 14:01:57 +0000
Subject: Re: Re: HTML layout and arrays (WAS : Brain not working, helpneeded :-). .
References: 1  Groups: php.db 
Request: Send a blank email to php-db+get-40168@lists.php.net to get a copy of this message
Norland, Martin wrote:
while ($row = mysql_fetch_array($sql_result) { $videos[] = array( 'id' => $row['id'], 'video_link' => $row['video_link'], 'video_thumbnail' => $row['video_thumbname'], 'video_title' => $row['video_title'], 'video_description' => $row['video_description'], ); }
or you could use the row id (assuming that $row['id'] is a unique field for each row) as your 'count' like this: while ($row = mysql_fetch_array($sql_result) { $videos[$row['id']]['id'] = $row['id']; $videos[$row['id']]['video_link'] = $row['video_link']; etc....... }

« previous php.db (#40168) next »