Link to home
Start Free TrialLog in
Avatar of acslater
acslater

asked on

urgent: php forum error

Installation Completed.
Data base references updated
Proceed as Administrator

the problem is when i click to proceed as administator i get the following

errorDatabase error occured: Access denied for user: '@localhost' to database 'gamesemp_cart'
Cannot not select the database gamesemp_cart.
Using query:
Error in /BaalSystems/regadmin.
Avatar of Promethyl
Promethyl
Flag of United States of America image

>Enhanced free discussion form portal software, developed because most of the other portal software applications were !!! too difficult !!! to quickly install and manage.

lol!

Using 3.7 ?

Have you edited common_db.php?

Modify this : (common_db.php )

 $link_id=mysql_connect($dbhost,$dbusername,$dbuserpassword);
if( $link_id == 0 )
    return 0 ;

TO BE THIS:

$link_id=mysql_connect($dbhost,$dbusername,$dbuserpassword);
if( $link_id == 0 ) {
    echo mysql_error();
    return 0 ;
}

I want to see the error -- on the mysql side.
Avatar of acslater
acslater

ASKER

the error is not seen on the mysql side. it shows up when i try to install the forum for the first. That code that u gave me is not in common_db.php. The only code in it is

<?php
ob_start();

$start_time = split(" ", microtime());
$start_time = $start_time[1] + $start_time[0];

ini_set("magic_quotes_gpc", "0");
ini_set("magic_quotes_runtime", "0");

foreach($_GET as $key=>$value) {
    $_GET[$key]=addslashes($value);
}

foreach($_POST as $key=>$value) {
    $_POST[$key]=addslashes($value);
}

foreach($_COOKIE as $key=>$value) {
    $_COOKIE[$key]=addslashes($value);
}

include("incl/db.php");
include("incl/functions.php");
include("incl/prefs.php");
include("incl/int_std.php");

db_connect();

session_start();

?>
Have you edited incl/db.php with your database's information?

Below is the other db_connect. ;)

Verify your mysql host, username and password. Mysql is now allowing you access to the database.  Verify permissions.

   function db_connect() {
        global $db;
        if (!mysql_connect($db["host"], $db["user"], $db["pass"]))
            db_report_error("Cannot not connect to the database");
        if (!mysql_select_db($db["dbname"]))
            db_report_error("Cannot not select the database <i>" . $db["dbname"] . "</i>");
    }
   
    function db_report_error($message="", $query="") {
        echo("Database error occured: " . mysql_error() . "<br><b>" . $message . "</b>" . ".<br>Using query: <b>" . $query . "</b><br>Error in " . $_SERVER["PHP_SELF"]);
        exit;
    }

> errorDatabase error occured: Access denied for user: '@localhost' to database 'gamesemp_cart'

Looking at this error, it looks like the username field is blank.

Make sure to setup that db.php!

I bet the username field is blank!
i have edited incl/db.php with my database's information and verified permissions and entered that code for db.php and am still getting the error. Then when i went back into db.php the code u gave me disappears. it looks from the error that the username field is blank but it's not. i hav a presentation to do in college 2moro that is why i need it to work. any ideas

all the installation details are entering into the d/b its just getting to the admin stage thats the problem
Wait a sec... are you calling this program from within another function? If so, in db.php change:
<?
    $db=array(
              "host"=>"localhost",
              "user"=>"root",
              "pass"=>"",
              "dbname"=>""
             );
               
    $tableprefix="_";
?>
 to read:

<? global $db;
    $db=array(
              "host"=>"localhost",
              "user"=>"root",
              "pass"=>"",
              "dbname"=>""
             );
               
    $tableprefix="_";
?>
if anyone can help at all i would be very appreciative
ASKER CERTIFIED SOLUTION
Avatar of Promethyl
Promethyl
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
nice one Promethyl ur a legend
Well, thank you, but what was the problem?