Hi all i am fairly new to using PHp and creating my own code however i am trying to install a script on my site and i get this message when i go to my home page to set everythink up “Parse error: syntax error, unexpected ‘;’, expecting T_OLD_FUNCTION or T_FUNCTION or T_VAR or ‘}’ in /home/sgcrys5/public_html/include/sql.inc.php on line 1” i have no idea were the error is in the code i have looked for a “,” that is out of place and cannot spot 1 the full code is listed bellow, i hope someone can help me with this. thanks.
<?php
class sql
{
var $mysql_type = 1;
var$sql_server_type= 2;
var$db_type = 1; //mysql
function sql( $db_type )
{
$this->db_type = $db_type;
}
function connection( $dm_name, $db_name, $db_username, $db_password, &$err )
{
if ( $this->db_type == $this->mysql_type )
{
$db = mysql_connect($dm_name, $db_username, $db_password );
if ( $db != FALSE )
{
if ( !@mysql_select_db($db_name,$db) )
{
$err = "select database error: " . mysql_error();
return FALSE;
}
}
else
{
$err = "mysql_connect error: " . mysql_error();
return FALSE;
}
}
else
{
$err = "not supported";
return FALSE;
}
return $db;
}
function sql_query($sql, $db, &$err)
{
if ( $this->db_type == $this->mysql_type )
{
$res = @mysql_query($sql, $db);
if ( !$res )
{
$err = mysql_error();
return FALSE;
}
return $res;
}
}
function sql_next_row(&$res )
{
if ( $this->db_type == $this->mysql_type )
{
return mysql_fetch_row($res);
}
}
function sql_num_row($res)
{
if ( $this->db_type == $this->mysql_type )
{
return @mysql_num_rows($res);
}
}
function sql_close($db)
{
if ( $this->db_type == $this->mysql_type )
{
@mysql_close($db);
}
}
function sql_free_result($res)
{
if ( $this->db_type == $this->mysql_type )
{
@mysql_free_result($res);
}
}
function sql_field_name($res,$index)
{
if ( $this->db_type == $this->mysql_type )
{
return @mysql_field_name($res,$index);
}
}
function sql_insert_id($res)
{
if ( $this->db_type == $this->mysql_type )
{
return mysql_insert_id($res);
}
}
}
?>