How to setting my data base ?

Discussion in 'PHP' started by piropeator, May 14, 2010.

  1. #1
    Some body can help me to setting this project ?

    https://sourceforge.net/projects/data4php5/

    I get this message error:

    Connecting to database...
    Warning: mysql_connect() [function.mysql-connect]: Access denied for user 'ODBC'@'localhost' (using password: NO) in C:\www\data\data4php5\DATA\MySQL5\Access.php on line 27
    etc,etc..
    :confused:
     
    piropeator, May 14, 2010 IP
  2. JAY6390

    JAY6390 Peon

    Messages:
    918
    Likes Received:
    31
    Best Answers:
    0
    Trophy Points:
    0
    #2
    You need to configure the database settings (username password host etc)
     
    JAY6390, May 14, 2010 IP
  3. piropeator

    piropeator Well-Known Member

    Messages:
    194
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    121
    #3
    ok, but where ?? :confused::confused:
    I don't find where configure the database settings... I lost...
     
    piropeator, May 14, 2010 IP
  4. swashata

    swashata Member

    Messages:
    86
    Likes Received:
    2
    Best Answers:
    0
    Trophy Points:
    43
    #4
    Make sure you have a database named 'test' in your MySQL server. Now edit the example.php file:

    There you will find something like this:
    require_once('data.mysql5.lib.php');
    
    echo "Connecting to database...\n";
    $DB->connect();
    $DB->selectSchema('test');
    PHP:
    What it does is, first connects to the Database and then use the database 'test'. Basically here $DB->connect(); is the portion where you need to pass your MySQL server information. Replace that line with the following:
    $server = "localhost"; //MySQL server name
    $user= "root"; //MySQL username
    $pass = ""; //MySQL root password
    $DB->connect($server, $user, $pass);
    PHP:
    If you wish to select another database rather than test then replace the code $DB->selectSchema('test'); with $DB->selectSchema('your_db_name');

    I hope you have got it now... Basically this is the way of using the class!
     
    swashata, May 14, 2010 IP