$db = mysql_pconnect( "localhost", "username", "password" )or die("could not connect".mysql_error());
$db_connect = mysql_select_db("users", $db)or die("could not select database".mysql_error());
$query = "SELECT COUNT(*) FROM users WHERE username='".$_SESSION['user_name']."' AND password='little'";
$result = mysql_query ($query, $db_connect)or die("<br>could not select count<br>".mysql_errno()." end error.");
The above code dies at $result and displays "could not select count" but then the error number comes back 0 which means there is no error. So why is it dieing?
I've echoed out the query string and then copied that into the mysql front and it comes up with a count number so there's some error in my php, but I can't for the life of me figure out what.
Any help much appreciated.