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

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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.......
}

--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [PHP Users]     [Postgresql Discussion]     [Kernel Newbies]     [Postgresql]     [Yosemite News]

  Powered by Linux