+ Reply to Thread
Results 1 to 3 of 3

Thread: Connect to database

  1. #1
    Junior Member inkmon is on a distinguished road
    Join Date
    Sep 2011
    Posts
    6

    Connect to database

    I have a database called las created. I wish to connect to it via php
    Could you advise the format of
    dbhost = " ";
    dbname = " ";
    dbuser = "log in user name";
    dbpassword= "log in password";
    I have tried specifying the values including the domain as I thought it should be but have it wrong I have tried for instance "domain_las"; las being the database name. The other entries I have placed in like manner.

  2. #2
    Moderator Dratas is on a distinguished road Dratas's Avatar
    Join Date
    Apr 2010
    Posts
    144

    Re: Connect to database

    In order to create MySQL database which is essential thing for most CMS and blog systems you must:
    1. Login to DirectAdmin server control panel.
    2. Locate MySQL Management.
    3. Click on Create new Database.
    4. Enter Database Name, Database Username, Username Password, Confirm Password.
    5. Click Create.

    My blog

  3. #3
    Junior Member inkmon is on a distinguished road
    Join Date
    Sep 2011
    Posts
    6

    Re: Connect to database

    Thanks for reply but
    I repeat
    I have a database called las_art created. I wish to connect to it via php

    I am asking how to specify the php connection algorithm to an already created database
    my domain is las.jp22.net

    I need to fill this statement but all combinations of entries I have tried have failed

    if(!$dbConn = mysql_connect($dbhostname,$dbname,$dbusername,$dbpassword ))
    die('I could not connect to the database. Clease check the inc_dbcon file and make sure everything is correct.');
    if(!mysql_select_db($dbname, $dbConn))
    die('I could not select the database. Check the inc_dbcon file and make sure everything is correct.');
    for instance how do I fill this variable
    $dbusername =" ";

    I hope that stops confusion

+ Reply to Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34