I have a database with three columns: ID, UniqueID, FileName. I am trying to extract the FileName based on the UniqueID and then print it to the screen. This is what I have: ShowRandomPic(); function ShowRandomPic(){ $con = mysql_connect("localhost", "DB_User", "Password"); if (!$con) { die('Could not connect: ' . mysql_error()); } $DB = "DataBase"; mysql_select_db($DB) or die(mysql_error()); $result = mysql_query("SELECT * FROM table WHERE UniqueID = 'nCSoHUaDMz'"); $row = mysql_fetch_assoc($result); $filename = $row['FileName']; echo $filename; } Code (markup): When the page is loaded the screen is just blank. I cannot for the life of me figure out what I am doing wrong. Any ideas? Thanks a lot, Pat
wow guys... sorry, I made a ridiculous mistake. My opening tag was "<PHP?" instead of "<?PHP" Problem SOLVED.