Forum Moderators: coopster
A table with several rows. Each row has 11 columns... The first column is the unique ID. The remaining ten are varchar columns meant to hold the filename of a given image (for instance [primarykey]1.jpg, [primarykey]2.jpg, etc.) I then have a javascript photo browser, where each photo name is loaded dynamically into a list with a repeating region assigned:
<option name="<php code here>">
This all works fine, however, not all rows have 10 photos. So, I need to know how NULL works. Can I code my option list so that it will not insert another entry if the corresponding field is NULL?
How would anyone recommend going about this?
if you are using a repeated name like that why not just have 2 columns?
id and number of pics
then you could just loop it to create the names
$i = 0;
while ($i <= $numpics) {
echo '<option name="',$id,$i,'.jpg">';
$i++;
}
where $id is the primary key from any given row and $numpics is the number of images in that same row