Birdie312
06-11-2006, 09:04 PM
<?
$mysqluser = "root";
$mysqlpass = "pass";
$mysqlhost = "localhost";
$mysqldb = "db";
$rootpath = "/somewhere/";
mysql_connect($mysqlhost,$mysqluser,$mysqlpass);
mysql_select_db($mysqlpass);
$ip = $_SERVER['REMOTE_ADDR'];
$sql = "SELECT * FROM portal_logintrys WHERE ip='$ip'";
$query = mysql_query($sql);
$numrows = mysql_num_rows($query);
echo $numrows;
?>
the error is..
Warning: mysql_num_rows(): supplied argument is not a valid MySQL result resource in
Warning: mysql_fetch_object(): supplied argument is not a valid MySQL result resource in
For some reason this wont work, neither would it work for mysql_fetch_array();
Any thoughts on why it doesnt work?
any ideas will be greatly appreciated. thanks :thumbsup:
$mysqluser = "root";
$mysqlpass = "pass";
$mysqlhost = "localhost";
$mysqldb = "db";
$rootpath = "/somewhere/";
mysql_connect($mysqlhost,$mysqluser,$mysqlpass);
mysql_select_db($mysqlpass);
$ip = $_SERVER['REMOTE_ADDR'];
$sql = "SELECT * FROM portal_logintrys WHERE ip='$ip'";
$query = mysql_query($sql);
$numrows = mysql_num_rows($query);
echo $numrows;
?>
the error is..
Warning: mysql_num_rows(): supplied argument is not a valid MySQL result resource in
Warning: mysql_fetch_object(): supplied argument is not a valid MySQL result resource in
For some reason this wont work, neither would it work for mysql_fetch_array();
Any thoughts on why it doesnt work?
any ideas will be greatly appreciated. thanks :thumbsup: