MSUK1 Posted February 12, 2011 Share Posted February 12, 2011 Fatal error: Cannot redeclare class MySQLDB in /home/xservers/public_html/skylar/VIP/include/database.php on line 14 Quote Link to comment https://forums.phpfreaks.com/topic/227417-fatal-error-cant-figure-it-out/ Share on other sites More sharing options...
Pikachu2000 Posted February 12, 2011 Share Posted February 12, 2011 Code? Quote Link to comment https://forums.phpfreaks.com/topic/227417-fatal-error-cant-figure-it-out/#findComment-1173044 Share on other sites More sharing options...
MSUK1 Posted February 12, 2011 Author Share Posted February 12, 2011 well its a lot of code its a system login and out... it didnt occur till i stupidly "replace all files" too include session.php but, ive looked on the page this is occuring and it doesnt seem to include two sesisons? so im lost the code on db line 14 is a class: { var $connection; //The MySQL database connection var $num_active_users; //Number of active users viewing site var $num_active_guests; //Number of active guests viewing site var $num_members; //Number of signed-up users /* Note: call getNumMembers() to access $num_members! */ /* Class constructor */ function MySQLDB(){ /* Make connection to database */ $this->connection = mysql_connect(DB_SERVER, DB_USER, DB_PASS) or die(mysql_error()); mysql_select_db(DB_NAME, $this->connection) or die(mysql_error()); /** * Only query database to find out number of members * when getNumMembers() is called for the first time, * until then, default value set. */ $this->num_members = -1; if(TRACK_VISITORS){ /* Calculate number of users at site */ $this->calcNumActiveUsers(); /* Calculate number of guests at site */ $this->calcNumActiveGuests(); } } Quote Link to comment https://forums.phpfreaks.com/topic/227417-fatal-error-cant-figure-it-out/#findComment-1173046 Share on other sites More sharing options...
jcbones Posted February 12, 2011 Share Posted February 12, 2011 So, maybe instead of "include" you should use "include_once". Quote Link to comment https://forums.phpfreaks.com/topic/227417-fatal-error-cant-figure-it-out/#findComment-1173047 Share on other sites More sharing options...
MSUK1 Posted February 12, 2011 Author Share Posted February 12, 2011 to the session include or something in db.php? Quote Link to comment https://forums.phpfreaks.com/topic/227417-fatal-error-cant-figure-it-out/#findComment-1173048 Share on other sites More sharing options...
Pikachu2000 Posted February 12, 2011 Share Posted February 12, 2011 Is that script inadvertently being include()d more than once? Perhaps by including another script that includes it? Quote Link to comment https://forums.phpfreaks.com/topic/227417-fatal-error-cant-figure-it-out/#findComment-1173053 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.