PHP Returns an error on line 35 .. it's the very last line of code .. theirs alot more code but thats what line the error is on , whats wrong with this?
<?php
// INCLUDES AND GLOBALS
include("./admin/config.php");
include("$include_path/common.php");
global $HTTP_POST_VARS,$HTTP_GET_VARS,$HTTP_SESSION_VARS;
global $_SESSION;
// Fetch the image array sent by preupload.php
$photos_uploaded = $_FILES['photo_filename'];
// Fetch the image caption array
$photo_captions = $_POST['photo_captions'];
// what files shall we allow
$photo_types = array(
'image/pjpeg' => 'jpg',
'image/jpeg' => 'jpg',
'image/x-png' => 'png'
);
///////////////////////////// check to make sure the filesize upload is not 0 bytes
while($counter <= count($photos_uploaded)) {
if($photos_uploaded['size'][$counter] > 0) {
if(!array_key_exists($photos_uploaded['type'][$counter], $photo_types)) {
$result_final .= 'File ' . ($counter + 1) .
' is not a photo<br />';
} else {
// Great the file is an image, we will add this file
}
}
}
////////////////////////////add the database entry for the image
$query = mysql_query("
INSERT INTO shocc_gallery_photos (
photo_filename,
photo_caption,
photo_category
) VALUES (
'0',
'" . $photo_captions[$counter]) . "',
'" . $_POST['category'] . "'
)
"); //ERROR
Thanks for any help ...