I don't know why I continue getting such errors .With this one I can't even locate where the problem is.Its a database class for accessing information from a website database.[php]
<?
/**
* Database.php
*/
include("consta nts.php");
include("db_con n.php");
class Users
{
var $connection; //The MySQL database connection
var $num_active_use rs; //Number of active users viewing site
var $num_active_gue sts; //Number of active guests viewing site
var $num_members; //Number of signed-up users
/* Note: call getNumMembers() to access $num_members! */
/* Class constructor */
function Users(){
/* Make connection to database */
$this->connection = mysql_connect(' localhost', 'root', 'password') or die(mysql_error ())
mysql_select_db (Users, $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_VISITO RS){
/* Calculate number of users at site */
$this->calcNumActiveU sers();
/* Calculate number of guests at site */
$this->calcNumActiveG uests();
}
}
[/php]
Now the error is :Parse error: parse error, unexpected T_STRING in c:\inetpub\wwwr oot\croco\tserv er\login system v.2.0\include\d atabase.php on line 25
where line 25 is: mysql_select_db (Users, $this->connection) or die(mysql_error ());
Please help me I'm tired of this and I need to move on
Thank you in advance
jecha
<?
/**
* Database.php
*/
include("consta nts.php");
include("db_con n.php");
class Users
{
var $connection; //The MySQL database connection
var $num_active_use rs; //Number of active users viewing site
var $num_active_gue sts; //Number of active guests viewing site
var $num_members; //Number of signed-up users
/* Note: call getNumMembers() to access $num_members! */
/* Class constructor */
function Users(){
/* Make connection to database */
$this->connection = mysql_connect(' localhost', 'root', 'password') or die(mysql_error ())
mysql_select_db (Users, $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_VISITO RS){
/* Calculate number of users at site */
$this->calcNumActiveU sers();
/* Calculate number of guests at site */
$this->calcNumActiveG uests();
}
}
[/php]
Now the error is :Parse error: parse error, unexpected T_STRING in c:\inetpub\wwwr oot\croco\tserv er\login system v.2.0\include\d atabase.php on line 25
where line 25 is: mysql_select_db (Users, $this->connection) or die(mysql_error ());
Please help me I'm tired of this and I need to move on
Thank you in advance
jecha
Comment