1 Reply Latest reply on Feb 16, 2011 4:26 PM by zzipper7

    php database.php help!!

    spooonynick

      heya everyone im making a empire building game in php for now just to see how it go's etc

       

      anyway ive got basics sorted kind of

      but now im getting ALOT of errors in my database.php file ALOT

       

      here is the the errors i get on homepage of game site,.

       

      "Warning:  mysql_query(): supplied argument is not a valid MySQL-Link resource in /www/zzl.org/s/p/o/spoonynicks/htdocs/include/database.php on line 380

      Warning:  mysql_num_rows(): supplied argument is not a valid MySQL result resource in /www/zzl.org/s/p/o/spoonynicks/htdocs/include/database.php on line 381

      Warning:  mysql_close(): supplied argument is not a valid MySQL-Link resource in /www/zzl.org/s/p/o/spoonynicks/htdocs/include/database.php on line 383

      Warning:  mysql_query(): supplied argument is not a valid MySQL-Link resource in /www/zzl.org/s/p/o/spoonynicks/htdocs/include/database.php on line 402

      Warning:  mysql_numrows(): supplied argument is not a valid MySQL result resource in /www/zzl.org/s/p/o/spoonynicks/htdocs/include/database.php on line 404
      "

       

      as you can tell this anit so good for me

       

      in my databse file this is the first error line

      " /* Calculate number of users at site */
            $q = "SELECT * FROM ".TBL_ACTIVE_USERS;

       

          $result = mysql_query($sql,$con);
      echo mysql_num_rows($result);

       

      }"

       

       

      im stuck i have changed everything i can think of ive got new codes etc

       

       

      HERE IS THE DOWNLOAD LINK FOR DATABASE.PHP

      please download file and please if you can help please please do so.

       

      THANK YOU SO MUCH!!!!

      http://www.2shared.com/file/9HjFaj2p/database.html

        • 1. Re: php database.php help!!
          zzipper7 Level 1

          Looks to me like TBL_ACTIVE_USERS is a MySQL table name?  If so you need to make it part of the string.

          $q = "SELECT * FROM TBL_ACTIVE_USERS";

           

          If TBL_ACTIVE_USERS is a variable, then it needs the '$'..   $TBL_ACTIVE_USERS

           

          Am I not understanding the definition of TBL_ACTIVE_USERS ??

           

          Good luck.