So I'm creating a photo gallery for a social network. At the minute I'm creating a pre-upload page. I have set up 5 fields to enter images with appropriate captions. However, my main issue is populating the drop-down list. The drop-down list should contain categories of photos from a database (photo_category), but the drop-down list is turning up empty. Any suggestions on where I'm going wrong?
Edit: so now I've changed what's in $row by adding category_id and category_name but it now says " Parse error: syntax error, unexpected T_ENCAPSED_AND_WHITESPACE, expecting T_STRING or T_VARIABLE or T_NUM_STRING on line 16". The line in quesion is preceded by 2 stars.
<?php
require 'configphot.inc.php';
$_photo_upload_fields='';
$count=1;
$nofields=(isset($_GET['number_of_fields']))?
(int) ($_GET['number_of_fields']):5;
$result = mysqli_query($link,"SELECT category_id, category_name FROM photo_category");
while($row=mysqli_fetch_array($result)){
$_photo_category_list .= <<<__HTML_END
**<option value="$row['category_id']">$row['category_name']**</option>n
__HTML_END;
}
mysqli_free_result($result);
while($counter<=$nofields)
{
$photo_upload_fields .= <<<__HTML_END
<tr><td>
Photo{$counter}:
<input name = "photo_filename[]" type= "file" />
</td></tr>
<tr><td>
Caption:
<textarea name ="photo_caption[]" cols = "30" rows ="1"></textarea>
</td></tr>
__HTML_END;
$counter++;
}
//End output
echo <<<__HTML_END
<html>
<head>
<title> Upload photos here</title>
</head>
<body>
<form enctype="multipart/form-data" action="upload.php" method="post" name= "upload_form">
<table width="90%" border="0" align="center" style="width: 90%;">
<tr>
<td>Select Category
<select name="category">
$photo_category_list</select></td>
</tr>
<!image fields here -->
$photo_upload_fields
<tr><td>
<input type ="submit" name="submit" value= "Add photos">
</td></tr>
</table>
</form>
</body>
</html>
__HTML_END;
?>