Sir I corrected the number of { and } both are 22 now...
Still the error is the same My code looks like this now
<?php
class sql
{
var $dbhost;
var $dbuser;
var $dbpass;
var $dbase;
var $sql_query;
var $mysql_link;
var $sql_result;
var $query_count;
function sql()
{
$this->dbhost = 'localhost';
$this->dbuser = '';
$this->dbpass = '';
$this->dbase = 'poo_heads';
$this->mysql_link = '0';
$this->query_count = '0';
$this->sql_result = '';
$this->connection();
} //function sql
function connection()
{
$this->mysql_link = @mysql_connect( $this->dbhost, $this->dbuser, $this->dbpass ) or $this->error( mysql_error( $this->mysql_link ), $this->sql_query, mysql_errno( $this->mysql_link ) );
@mysql_select_db( $this->dbase ) or $this->error( mysql_error( $this->mysql_link ), $this->sql_query, mysql_errno( $this->mysql_link ) );
} //function connection
function error( $error_msg, $sql_query, $error_no )
{
$error_date = date("F j, Y, g:i a");
//Heredoc Strings must be on the far left lines
$error_page=<<<EOD
<html><head><title>mySQL database Error</title>
<style>P,BODY{ font-family:arial,sans-serif; font-size:11px; }</style></head><body>
<br><br><blockquote><b>There appears to be an error while trying to complete your request.</b><br>
You can try to go back and try again by clicking <a href="javascript:history.go(-1);">here</a>, if you
still get the error you can contact the site administrator by clicking <a href='mailto:haiden@asciant.net?subject=SQL+Error'>here</a>
<br><br><b>Error Returned</b><br>
<form name='mysql'><textarea rows="15" cols="60">mySQL query error: {$sql_query}
mySQL error: {$error_msg}
mySQL error code: {$error_no}
Date: {$error_date}</textarea></form><br>We apologise for any inconvenience</blockquote></body></html>
EOD;
echo $error_page;
} //error
function close()
{
mysql_close( $this->mysql_link );
} //close
function sql_query( $sql_query )
{
$this->sql_query = $sql_query;
$this->sql_result = @mysql_query( $sql_query, $this->mysql_link );
if (!$this->sql_result)
{
$this->error( mysql_error( $this->mysql_link ), $this->sql_query, mysql_errno( $this->mysql_link ) );
} //if
$count = $this->query_count;
$count = ($count + 1);
$this->query_count = $count;
} //sql query
function num_rows()
{
$mysql_rows = mysql_num_rows( $this->sql_result );
if (!$mysql_rows)
{
$this->error( mysql_error( $this->mysql_link ), $this->sql_query, mysql_errno( $this->mysql_link ) );
} //if
return $mysql_rows;
} //num_rows
function affected_rows()
{
$mysql_affected_rows = mysql_affected_rows( $this->mysql_link );
return $mysql_affected_rows;
} //affected rows
function fetch_array()
{
if ( $this->num_rows() > 0 )
{
$mysql_array = mysql_fetch_assoc( $this->sql_result );
if (!is_array( $mysql_array ))
{
return FALSE;
}//if
return $mysql_array;
} //if
} //fetch array
function fetch_rows()
{
if ( $this->num_rows() > 0 )
{
$mysql_array = mysql_fetch_row( $this->sql_result );
if (!is_array( $mysql_array ))
{
return FALSE;
}
return $mysql_array;
}
} //fetch row
function query_count()
{
return $this->query_count;
} //query count
}
?>