also try to: echo mysql_error();
after the select-query, it will tell you what went wrong. Thomas On Fri, 17 May 2002 18:45:07 +0100 [EMAIL PROTECTED] (Randum Ian) wrote: > 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 > [EMAIL PROTECTED] > http://www.danceportal.co.uk > DancePortal.co.uk - Global dance music media > -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php