For the second one, you'd create a template and inlclude anything you want repeated inside of it (could be rows of a table (including the $webcamurl)). Then just insert $variable into your main template, and it will repeat the contents.
Edit: by the way, if your php file isn't associated with vBulletin (doesn't include global.php) you have to use mysql_query instead of $DB_site->query and mysql_fetch_array instead of DB_site->fetch_array. Also, if this is the case, you can't use templates, obviously.
thanks for the info.
Yerah it's going to include global.php. so it will work, but thanks for the info.