morrisjohnny Posted April 23, 2007 Share Posted April 23, 2007 i'm sur ei've had this code working on windows yet when i switched to linux it doesn't work anyone see what the problem is?I get an error saying"mysql_num_rows supplied argument is not a valid mysql result resource (directory) on line 22"and"mysql_num_rows supplied argument is not a valid mysql result resource (directory) on line 32"line 22 is"if(mysql_num_rows($query) == 1)"and line 32 is"mysql_close($db);"here is the code for the login_check <?phpsession_start();$logged_in = false;$msg = "";if ($_SESSION['online']) $logged_in = true;else if (isset($_POST['username'])){ $db=mysql_connect("localhost", "root", ""); mysql_select_db("mt", $db); $username = htmlentities($_POST['username']); $password = htmlentities($_POST['password']); $username = mysql_real_escape_string($username); $password = mysql_real_escape_string($password); $query = mysql_query("SELECT login, pazzword FROM Users WHERE login = '$username' AND pazzword = '$password'"); if(mysql_num_rows($query) == 1) /*line 23*/ { $_SESSION['online'] = true; $_SESSION['username'] = $username; $logged_in = true; } else $msg .= "The username and password did not match.<br /><br />"; mysql_free_result($query); mysql_close($db); /*Line 32*/}?> Link to comment Share on other sites More sharing options...
Mr_CHISOL Posted April 23, 2007 Share Posted April 23, 2007 The row that causes the problem is this one: $query = mysql_query("SELECT login, pazzword FROM Users WHERE login = '$username' AND pazzword = '$password'"); Two suggestions:Add echo mysql_error(); after the mysql_query-lineMake sure that you have the table Users set up right... Link to comment Share on other sites More sharing options...
morrisjohnny Posted April 23, 2007 Author Share Posted April 23, 2007 Okay, you've done it again :)Simple error, the tabl ewas users not Users, didn't know it was that senstive :S :)Thanks again mate Link to comment Share on other sites More sharing options...
Mr_CHISOL Posted April 23, 2007 Share Posted April 23, 2007 No Problems :?) Link to comment Share on other sites More sharing options...
primefalcon Posted April 24, 2007 Share Posted April 24, 2007 windows isn't case sensitive, linux is Link to comment Share on other sites More sharing options...
primefalcon Posted April 24, 2007 Share Posted April 24, 2007 same will go for urls, folders and evverything else Link to comment Share on other sites More sharing options...
Mr_CHISOL Posted April 24, 2007 Share Posted April 24, 2007 But the case-sensitivity wouldn't lie with the OS in this case as he uses MySQL on both systems it would behave in the same way (basically) (or isn't it like that? never used MySQL on win) Link to comment Share on other sites More sharing options...
primefalcon Posted April 25, 2007 Share Posted April 25, 2007 I read somewhere that windows is not case sensitive at all, though I use Linux myself Link to comment Share on other sites More sharing options...
jesh Posted April 25, 2007 Share Posted April 25, 2007 I read somewhere that windows is not case sensitive at all, though I use Linux myselfYeah, with SQL Server and MySQL on Windows, the following queries are identical:SELECT userid, username FROM users; SELECT UserID, UserName FROM Users; SELECT UsErId, UsErNaMe FROM uSeRs; Link to comment Share on other sites More sharing options...
justsomeguy Posted April 25, 2007 Share Posted April 25, 2007 It actually depends on the application. Apache on Windows is still case-sensitive, for example, at least with Tomcat. Link to comment Share on other sites More sharing options...
primefalcon Posted April 26, 2007 Share Posted April 26, 2007 right... so he was probably using II's before which wouldn't be Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.