Hi,
while($row = mysql_fetch_array($result))
Where does $result come from ? Is your query successfully executed?
$image_id = $row['image_id'];
$name = $row['name'];
$type = $row['type'];
$date_taken = $row['date_taken'];
$size_file = $row['size_file'];
$original_name = $row['original_name'];
$place = $row['place'];
$location_of_imagefile = $row['location_of_imagefile'];
$description = $row['description'];
$category = $row['category'];
Why do you convert your array to a bunch of variables? It's slowdown your whole script and is not necessary. Simply use the $row variable to echo the value!
$photo_display = $name;
Why don't you just use $name ?
$row++;
Why do you increment $row ? $row is an array of variables, you previously use it. You don't have to increment it. Don't even touch it because mysql_fetch_array use it! So your loop kind of destroy the variable, it alternates it.
echo "<img src=\"/nat_geo/images/$original_name\">
<BR><strong>Name: </strong>$name
<BR><strong>Date taken: </strong>$date_taken
<BR><STRONG>Size: </strong>$size_file MB
<BR><STRONG>Location: </STRONG>$place
<BR><STRONG>Category: </STRONG>$category
<BR><STRONG>Description: </STRONG>$description
<BR>";
First I was glad to see that you used ?><?php to output HTML but... Arg you used echo to display HTML and PHP. The best way is to escape from PHP and to use <?= ?>:
...PHP...?><img src="/nat_geo/images/<?= $row ["original_name"] ?>">
<BR><strong>Name: </strong><?= $row ["name"] ?>...
?>...PHP...
So I escape from PHP, using the ?><?php tags, then I display each variable with the <?= ?> echo shortcut, and I DO use the array itself and not the variables you defined. Shorter and faster.
?>
<INPUT TYPE="hidden" VALUE="full_name" NAME="$full_name">
<INPUT TYPE="hidden" VALUE="$chk_cnt" NAME="chk_cnt">
<INPUT TYPE="hidden" VALUE="$image_array[]" NAME="image_array">
<INPUT TYPE="hidden" VALUE="$name_array[]" NAME="name_array">
<INPUT TYPE="submit" NAME="submit" VALUE="Create Album"></P></form></CENTER>
<?
?> means that you escape from PHP, so "$chk_cnt" doesn't output a "38" for example, it output "$chk_cnt". Use the <?= "Your string" ?> tags, equivalent to <?php echo ("Your string"); ?>.
?>
<INPUT TYPE="hidden" VALUE="full_name" NAME="<?= $full_name ?>">
<INPUT TYPE="hidden" VALUE="<?= $chk_cnt ?>" NAME="chk_cnt">...
<?php
Last but not least <? is not valid, use <?php, it's standard and means "PHP script". <? means nothing even if it's allowed.
><TEXTAREA NAME="description" COLS=50 ROWS=10 WRAP=virutal>
virtual not virutal 🙂
Okay let's stop here and see you next week :p. I am sorry but there are tons of errors so I let you correct it from now and let's talk about it later.
JM