[!--quoteo--][div class=\'quotetop\']QUOTE[/div][div class=\'quotemain\'][!--quotec--] <? $db_host = "localhost"; $db_username = "aenigma_josh"; $db_password = "strg388"; $db_name = "aenigma_joshs"; if ( isset( $_POST["Submit"] ) ) { if ( !$link = mysql_connect($db_host, $db_username, $db_password)) { die( "Unable to connect to MySQL Server." ); } if ( !$dbselect = mysql_select_db($db_name, $link)) { die( "Unable to select MySQL database." ); } if ( isset( $_POST["username"] ) ) { $username = $_POST["username"]; } else { die( "You did not enter a username." ); } if ( isset( $_POST["password"] ) ) { $password = $_POST["password"]; } else { die( "You did not enter a password." ); } $query = "SELECT * FROM users WHERE username = '". mysql_real_escape_string($username) ."' AND password = '". md5($password) ."' LIMIT 1"; if ( !$result = mysql_query($query, $link)) { die( "Unable to run SQL query." ); } if ( mysql_num_rows( $result ) != 1 ) { die( "Invalid username or password" ); } else { $userinfo = mysql_fetch_array( $result ); } mysql_free_result( $result ); $day = date('d', time()); $month = date('m', time()); $year = date('Y', time()); $hour = date('H', time()); $min = date('i', time()); $sec = date('s', time()); $uid1 = md5(uniqid(rand(), true)); $uid2 = md5(uniqid(rand(), true)); $uid3 = md5(uniqid(rand(), true)); $sessionid = "'". $uid2 . $yeah . $sec ."'-'". day . $hour . $uid3 ."'-'". $min . $uid1 . $month ."'"; $sname = session_name("$sessionid"); session_start($sname); $_session['username'] = $userinfo[username]; $_session['displayname'] = $userinfo[displayname]; $_session['email'] = $userinfo[email]; $next = "index.php?page=news"; Header('Location: $next'); } ?>[/quote] Says "Unable to Run SQL Query" ANy ideas? lol.