[x]
Posted via EE Mobile

Search, ask, and monitor your questions on the go with EE Mobile. Visit Experts Exchange from your mobile device and never be out of touch again.

Question
[x]
Attachment Details
[x]
The Solution Rating System

With so many solutions, how can you tell which solutions are most likely to help you and which ones are not? To provide you with a tool to use, we rate our solutions based on various elements that most accurately determine if a solution is a quality solution. To explain what factors affect the solution rating, here are the elements we take into consideration when formulating our solution rating.

  • The Grade of the Solution
  • The Zone Rank of the Expert Providing the Solution
  • The Number of Author and Expert Comments
  • The Number of Experts Contributing
  • The Feedback of the Community

Your Input Matters
Because of the way the system is set up, the most important variable in this equation is you. As a member of Experts Exchange, you are able to cast your vote on the quality of the solutions in regard to how complete, accurate, helpful and easy to understand each solution is. When you provide your feedback, each rating is adjusted accordingly. So, if you see a solution that has a poor rating that you think is a good solution, let us know by rating it. As you do, the rating will be adjusted and will become more accurate for other members of our site.

If you have any suggestions that you would like to make for our rating system, please ask a question in the Suggestions Zone of Community Support.

Thank you!

6.8

php fatal error

Asked by sohaib69 in PHP Scripting Language

Tags: access, denied, error

Hi - !

I have beig trying to use that php software name popper, and when ever I try to run that file it just says that fatal error, its saying that class.db_tool.in.php on line 80 , here is the class.db_tool.in.php

Fatal error: Failed opening required '/home/admin/www/../popper.inc.php' (include_path='.:/usr/local/lib/php') in /home/admin/www/popper/class.db_tool.inc.php on line 80
----------------------------------------------------------
<?php

/*========================================================================
A POP3 web mail-client written in PHP
Copyright (C) 2000 by Jean-Pierre Bergamin

This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License.

For more information see the file gpl.txt or go to
http://www.gnu.org/copyleft/gpl.html

==========================================================================*/

class db_tool {

      var $db_data_inc = "";                  // contains the vars $host, $user, $pass
      var $db_link;
      // Overridable methods
      //
      // Adapt to other databases
      function db_tool($data_inc) {
            $this->db_data_inc = $data_inc;
      }

      function db_query($query) {
            return mysql_query($query);
      }

      function db_connect($host, $user, $pwd) {
            return @mysql_connect($host, $user, $pwd);
      }

      function fetch_array($res) {
            return mysql_fetch_array($res);
      }

      function fetch_row($res) {
            return mysql_fetch_row($res);
      }

      function insert_id() {
            return mysql_insert_id();
      }

      function affected_rows() {
            return mysql_affected_rows($this->db_link);
      }

      function db_error() {
            return mysql_error();
      }

      function db_data_inc($file) {
            if (empty($file)) {
                  // oops!
                  return;
            }
            $this->db_data_inc = $file;
      }

      function query($query, $link) {
            return mysql_query($query, $link);
      }

      // Private functions
      //
      // Don't use them in your code


      // Get the link to the db
      function link_db() {
            global $strings;
            $doc_root = getenv("DOCUMENT_ROOT");
            $path = $doc_root;
            if ($GLOBALS["in_docroot"] === false) {
                  $path .= "/..";
            }
            $path .= "/".$this->db_data_inc;
            require($path);
            $this->db_link = $this->db_connect($host, $user, $pass)
                  or die ($strings["l_ServerConnect"]."<br>".$this->db_error());

            $query = "USE $dbname";
            $this->query($query, $this->db_link)
                  or die ($strings["l_OpenDB"]."<br>".$this->db_error());
      }

      // Public functions

      // perform the query
      function db_query($query) {
            $this->link_db();
            return $this->query($query, $this->db_link);
      }

      function insert($tablename /* var. no. of strings of the variable names*/) {
            $num_args = func_num_args();
            $args = func_get_args();
            // Skip the table name as argument
            for($i = 1; $i < $num_args; $i++) {
                  $var_name = func_get_arg($i);
                  $col_names .= $var_name." ";
                  $values .= $GLOBALS["$var_name"]." ";
            }

            $col_names = str_replace(" ", ", ", trim($col_names));
            $values = str_replace(" ", ", ", trim($values));
            $query = "INSERT INTO $tablename ($col_names) VALUES ($values)";
            //echo $query;
            return;
            $res = $this->query($query);
            if ($res == 0) {
                  return 0;
            }

            return $this->insert_id();
      }

      function update($tablename, $where /* var. no. of strings of the variable names*/) {
            $num_args = func_num_args();
            $args = func_get_args();
            // Skip the table name and the WHERE clause arguments
            for($i = 2; $i < $num_args; $i++) {
                  $var_name = func_get_arg($i);
                  $update .= $var_name."=".$GLOBALS["$var_name"]." ";
            }
            $update = str_replace(" ", ", ", trim($update));

            $query = "UPDATE $tablename SET $update WHERE $where";
            //echo $query;
            return;
            $res = $this->query($query);
            if ($res == 0) {
                  return 0;
            }

            return $this->insert_id();
      }

      function store($tablename /* var. no. of strings of the variable names*/ /*the last arg is the where clause, pass empty string if it's an insert*/) {
            global $update;

            $num_args = func_num_args();
            $args = func_get_args();

            if (isset($update) && $update == 1) {
                  $num_args = func_num_args();
                  $args = func_get_args();
                  // Skip the table name and the WHERE clause arguments
                  for($i = 1; $i < $num_args - 1; $i++) {
                        $var_name = func_get_arg($i);
                        if (isset($GLOBALS[$var_name])) {
                              $update_str .= $var_name."='".$GLOBALS["$var_name"]."', ";
                        }
                  }

                  //$update_str = str_replace("' '", "', '", trim($update_str));
                  $update_str = ereg_replace(", $", "", $update_str);
                  $where = func_get_arg($num_args - 1);
                  $query = "UPDATE $tablename SET $update_str WHERE $where";
                  /*echo $query;
                  echo("<br>WHERE: $where");*/

                  $res = $this->db_query($query);
                  if ($res == 0) {
                        echo $this->db_error();
                        return 0;
                  }

                  return 1;
            }
            else {
                  // Skip the table name as argument
                  for($i = 1; $i < $num_args; $i++) {
                        $var_name = func_get_arg($i);
                        if (isset($GLOBALS[$var_name])) {
                              $col_names .= $var_name." ";
                              $values .= "'".addslashes($GLOBALS[$var_name])."' ";
                        }
                  }

                  $col_names = str_replace(" ", ", ", trim($col_names));
                  $values = str_replace("' '", "', '", trim($values));
                  $query = "INSERT INTO $tablename ($col_names) VALUES ($values)";

                  $res = $this->db_query($query);
                  if ($res == 0) {
                        //echo $this->db_error();
                        //echo "<br>Errno: ".mysql_errno();
                        return 0;
                  }

                  return $this->insert_id();
            }
      }


}
?>

I also try to make a database, like :-

mysql mail --user=dbusername -p < popper.mysql
Enter password:
ERROR 1045: Access denied for user: 'dbusername@localhost' (Using password: YES)

Why its saying Access Denied, I have a root access, then why is that..
 
Related Solutions
Keywords: php fatal error
 
Loading Advertisement...
 
[+][-]04/17/01 01:33 PM, ID: 6015084Expert Comment

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 30-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]04/17/01 11:35 PM, ID: 6015981Author Comment

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 30-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]04/18/01 09:30 AM, ID: 6017510Expert Comment

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 30-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]04/18/01 10:52 AM, ID: 6017767Author Comment

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 30-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]04/18/01 11:14 AM, ID: 6017825Expert Comment

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 30-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]04/18/01 12:14 PM, ID: 6017979Author Comment

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 30-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]04/18/01 01:13 PM, ID: 6018140Expert Comment

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 30-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]04/18/01 01:32 PM, ID: 6018205Author Comment

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 30-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]04/23/01 12:25 PM, ID: 6026883Accepted Solution

View this solution now by starting your 30-day free trial. Setting up your free trial is quick, easy, and secure. We will return you to this solution, unlocked, when you're done.

About this solution

Zone: PHP Scripting Language
Tags: access, denied, error
Sign Up Now!
Solution Provided By: potatotsang
Participating Experts: 2
Solution Grade: A
 
 
Loading Advertisement...
20091111-EE-VQP-89