mysql error

From: Date: Fri, 17 May 2002 17:45:07 +0000
Subject: mysql error
Groups: php.general 
Request: Send a blank email to php-general+get-98142@lists.php.net to get a copy of this message
Hi all, I have got this code but I can get it to work, it doesnt make sense! <snip> <?php $host="localhost"; $username="user"; $password="pass"; $database="admin"; $mysqlconnect = mysql_connect($host, $username, $password) or die ("Cannot connect to mySQL server, check it is running"); mysql_select_db($database, $mysqlconnect) or die ("Cannot connect to the database, check it is set right"); $result = mysql_query("SELECT * FROM user"); $count = mysql_num_rows($result); $counted = number_format($count); echo $counted; ?> <snip> but I am getting this error - "Warning: Supplied argument is not a valid MySQL result resource in /usr/home/e/a/eagadmin/public_html/main.php on line 14" but I dont understand why! Can anyone help? Regards, Ian. --- Randum Ian DJ / Reviewer / Webmaster, DancePortal (UK) Limited ian@danceportal.co.uk http://www.danceportal.co.uk DancePortal.co.uk - Global dance music media

« previous php.general (#98142) next »