Alan's TiVo Programs List


		    

getMessage() ); } if ($conn) { // The $conn(ection) is good, so let's look at the data. // Set the database with which we want to work. mysql_select_db("116539_web2spring2010", $conn); // Define the SQL query. $sql = "SELECT pid, name, descrip, rating, channel, startTime, lengthMinutes FROM TivoAlan ORDER BY channel, startTime"; // Send the SQL query and store the results, if any. $result = mysql_query($sql); if ($result) { // Iterate over the results, printing the data. for ($i = 0; $i < mysql_num_rows($result); ++$i) { print mysql_result($result, $i ,"channel") . " at "; print mysql_result($result, $i ,"startTime") . ": "; print mysql_result($result, $i ,"pid") . " "; print mysql_result($result, $i ,"name") . " "; print mysql_result($result, $i ,"descrip") . " "; print mysql_result($result, $i ,"rating") . " "; print mysql_result($result, $i ,"lengthMinutes") . " "; print "\n"; } // Free the $result. mysql_free_result($result); } else { // We got nothing returned from the query. print("The query [$sql] returned nothing."); } // Close the $conn(extion). mysql_close($conn); } else { // Our connection attempt failed. Admit this failure and the reason why. print( 'Could not connect: ' . mysql_error() ); } } ?>