This code is suppose to take the images array and use its value for the name of the table. When I echo the images varaible I get kids, which is what $images[3] is set to equal, but when I put it in the query the $result2 is echoed as resource id #4. Why is it doing that?
<?php
$con = mysql_connect("localhost","root","");
if (!$con)
{
die('Could not connect: ' . mysql_error());
}
mysql_select_db("photos", $con);
echo $images[3];
$query2="SELECT Location FROM $images[3] WHERE Pic_id='1'";
$result2 = mysql_query($query2) or die(mysql_error());
echo $result2;
mysql_close($con);
?>