Hey all - Been away from the programming world for a while (thank you Marine Corps), and am running into an error that has me stumped. Here's the error: Warning: mysql_fetch_assoc(): supplied argument is not a valid MySQL result resource in /home/lfg57/public_html/index.php on line 16 No database selected and here's the code (line 16 in BOLD): <?php ##ini_set('display_errors', 1); error_reporting(E_ALL); if (!isset($_SESSION)) { session_start(); } if(isset($_GET['aid'])&& $_GET['aid']!=''){ $_SESSION['aid'] = $_GET['aid']; } require_once('./Connections/lfg.php'); mysql_select_db($database_lfg, $lfg); checkCookie(); $g_getFree = "select * from Free_Weekends"; $r_getFree = mysql_query($g_getFree); $free = mysql_fetch_assoc($r_getFree); if (!is_null($free['Free']) && strtolower($free['Free'])!='no' && $free['Free']!=''){ $_SESSION['free'] ='yes'; }else{ $_SESSION['free'] ='no'; } //echo $_SESSION['free']."<BR>"; ?> Thank you in advance!
okay fixed the error by adding an "@" sign in line 16, but now it says no dbase selected. its weird this was working fine with no changes and then one morning this pops up.
Hello, May be the variable $database_lfg is not getting value you can echo it and check or you can hard code the database name and check if it works..