Hi there,
I purchased this script from someone but it is not working and this person has ignored my emails for about 4 months now.
So I'm hopping that a kind php pro can maybe help me fix this. This is a traffic trade script for a game site that displays games from friends sites.
Here is the db.php file.
<?php
$dbhost = 'localhost';
$dbusername = 'username';
$dbuserpassword = 'password';
$default_dbname = 'dbname';
$MYSQL_ERRNO = '';
$MYSQL_ERROR = '';
function db_connect($dbname="$default_dbname") {
global $dbhost, $dbusername, $dbuserpassword, $default_dbname, $dbname;
global $MYSQL_ERRNO, $MYSQL_ERROR;
$link_id = mysql_connect($dbhost, $dbusername, $dbuserpassword);
if(!$link_id) {
$MYSQL_ERRNO = 0;
$MYSQL_ERROR = "Connection failed to the host $dbhost.";
return 0;
}
else if(empty($dbname) && !mysql_select_db($default_dbname)) {
$MYSQL_ERRNO = mysql_errno();
$MYSQL_ERROR = mysql_error();
return 0;
}
else return $link_id;
}
function sql_error() {
global $MYSQL_ERRNO, $MYSQL_ERROR;
if(empty($MYSQL_ERROR)) {
$MYSQL_ERRNO = mysql_errno();
$MYSQL_ERROR = mysql_error();
}
return "$MYSQL_ERRNO: $MYSQL_ERROR";
}
?>
And here is the error I"m getting,
Parse error: syntax error, unexpected '"' in /home/username/public_html/directory/exchange/db.php on line 8
I have minimal understanding with php so an explanation may not help me, I would need to see the full code to the db.php file above with the correction if possible.
Any help would be really appreciated.