I worked on this for hours and I'm stuck. Below I pasted the script from a working MSSQL login which I changed to use with MySQL. I know that there are syntax differences and the hours I spent was replacing some of them in this script but I've got no where.
I keep getting invalid mysql result resource. Usually on ($result=mysql_query($sql)
;) however it changes to other lines depending the script.
A fix would be great I'm assuming its a quick thing I cant believe I cant get it working from my MySql book and online!
mysql_connect("$host", "$user", "$password")or die("cannot connect");
mysql_select_db("$database")or die("cannot select DB");
$sql="SELECT * FROM users WHERE username='$_POST[myusername]' AND pass='$_POST[mypassword]'";
// mysql_num_row is counting table row
// If result matched $myusername and $mypassword, table row must be 1 row
if($count==1) //Login details were found so auth