What is going wrong?
latin.allderek.com/input.html (this is a fourm that passes data to PHP)
<?php // Declare Buttons // Connect to Allderek.com Latin Vocab Database. $link = mysql_connect('localhost', 'allderek_latindb', 'latin'); if (!$link) { die('Could not connect: ' . mysql_error()); } $db_selected = mysql_select_db('allderek_latin', $link); if (!$db_selected) { die ('Cant use Latin DB' . mysql_error()); } // Cookie Check if($_COOKIE['wordid'] == null){ $chapbegin = $_POST['quizbegin']; //What chapter to begin Quizzing $chapend = $_POST['quizend']; // Last Chapter to Quiz } else { $done = $_COOKIE['done']; $wordid = $_COOKIE['wordid']; } // Begin Chapter Detection $beginrandq = mysql_query('SELECT MIN(ID) FROM vocab WHERE chapter BETWEEN '. $chapbegin.' and '. $chapend); // Assigns the first and last questions to quiz on $endrandq = mysql_query('SELECT MAX(ID) FROM vocab WHERE chapter BETWEEN '. $chapbegin.' and '. $chapend); $beginrand = mysql_fetch_array($beginrandq); //Convert Query to Array $endrand = mysql_fetch_array($endrandq); // Begin Quiz $wordid = rand($beginrand[0],$endrand[0]); //Sets which word will get drawn if($_COOKIE['wordid' == null]){ $endrandtemp = $endrand; $done[$endrandtemp]; } $done[$wordid]= 1; //Sets the latinword as done $query = mysql_query('SELECT LATIN FROM vocab WHERE id = '.$wordid); //Queries for word $latinword = mysql_fetch_array($query); //converts latin word to array // Save Vars to Cookie setcookie("wordid", $wordid, time()+3600); setcookie("done", $done, time()+3600); setcookie("chapbegin", $chapbegin, time()+3600); setcookie("chapend", $chapend, time()+3600); // Generate Page echo $latinword[0]; ?>