Sim Posted February 4, 2011 Share Posted February 4, 2011 How do I workaround this? says error is line 42 here is the begining of my file. The rest is just functions. So i'll show the function that is causing it. [syntax=php] <? //session stuff session_start(); //include required files. include "../config.php"; include "../phpMySQL.php"; include "../includes/constants.php"; //initiate class. $db = new phpMySQL($dbhost, $dbuser, $dbpass, $dbname); $db->connect(); [/syntax] line 42 is $query = $db->query [syntax=php]//attempt to login user function userLogin() { //check if username pass string test if(checkUser() == true && checkPass() == true) { //query to check if user name or email in use $query = $db->query("SELECT userID, userActCode, userRank, COUNT(userID) as counts FROM " . USER_TABLE . "' WHERE userHandle='" . $db->escape($_POST['textUser']) . "' OR userPass='" . $db->escape($_POST['textPass']) . "'"); $rec = $db->fetch_array($query); //user name and password match if($rec['counts'] == 1) { //user account activated if($rec['userActCode'] == 0) { $_SESSION['userID'] = $rec['userID']; $_SESSION['userRank'] = $rec['userRank']; //update last activitity $data = array("userLastActive" => time()); $db->update(USER_TABLE, $data, "userID='" . $rec['userID'] . "'"); die('Login Successfull, Redirecting...<script type="text/javascript">window.location = "' . $pather . '"</script>'); } else { //display error die("You must first activate your account..."); } } else { //display error die("Incorrect User name and password combination..."); } } else { //display error die($_SESSION['msg']); } }[/syntax] Quote Link to comment Share on other sites More sharing options...
Equinox Posted February 4, 2011 Share Posted February 4, 2011 I'm never sure if you're being serious or not, but anyway. function userLogin() { global $db; Quote Link to comment Share on other sites More sharing options...
Sim Posted February 4, 2011 Author Share Posted February 4, 2011 I'm never sure if you're being serious or not, but anyway. [/php] lol. I really laughed out load. Quote Link to comment Share on other sites More sharing options...
Equinox Posted February 4, 2011 Share Posted February 4, 2011 I'm never sure if you're being serious or not, but anyway. [/php] lol. I really laughed out load. So....you're not being serious? Quote Link to comment Share on other sites More sharing options...
Sim Posted February 4, 2011 Author Share Posted February 4, 2011 I don't understand why you think I am not serious. Quote Link to comment Share on other sites More sharing options...
Danny696 Posted February 4, 2011 Share Posted February 4, 2011 You sell php engines, yet you cant do this, mabey that why he, and me too, thinks your not serious.... Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.