Jump to content

parse error


crouchjay

Recommended Posts

The following is the code. I keep getting a
Parse error: parse error, unexpected T_STRING, expecting T_OLD_FUNCTION or T_FUNCTION or T_VAR or '}' in /home/crouchja/public_html/mysql.class.php on line 5.

<?php

class mysql {

**I am assuming this is line 5--> private $linkID; //MySQL link identifier
private $host; //MySQL server host
private $user; //MySQL user
private $pswd; //MySQL password
private $db; //MySQL database
private $result; //Query result
private $querycount; //Total queries executed

/* Class constuctor. Initializes the $host, $user, $pswd and $db fields. */
function mysql($host, $user, $pswd, $db)
{
$this->host = $host;
$this->user = $user;
$this->pswd= $pswd;
$this->db = $db;
}//End of mysql constuctor

/*Connects to the MySQL database server. */
function connect()
{
try {
$this->linkID = @mysql_connect($this->host,$this->user,$this->pswd);
if (! $this->linkID)
throw new Exception ("Could not connect to the database server1.");
}//End of try
catch (Exception $e) {
die ($e->getMessage());
}//End of catch
}

/* Selects the MySQL database. */
function select()
{
try {
if (! @mysql_select_db($this->db, $this->linkID))
throw new Exception("Could not connect to the database server2.");
}//end of try
catch (Exception $e) {
die ($e->getMessage());
}//end of catch
}
}
Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.