#1
  1. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jul 2000
    Posts
    33
    Rep Power
    15
    First of all thanks for firepage bundle and help I got through this forum.

    I have downloaded firepages bundle on 2k system and installed it. Apache, PHP, MySql are working without giving any problem so far.
    I need to know how to connect to database from PHP code. Generally I use this code for same.

    $hostname = "localhost";
    $username = "xyz";
    $password = "tmk700tr68";
    $dbName = "pqr";

    MYSQL_CONNECT($hostname, $username, $password) OR DIE("Unable to connect to database");

    @mysql_select_db("$dbName") or die("Unable to select database");
    $userstable = "jklm;


    I have not given any password and username while creating database in Mysql, in fact it never promted me for same.

    Help aprreciated.

  2. #2
  3. chown python:users\ /world
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jul 2000
    Location
    Texas Tech
    Posts
    95
    Rep Power
    15
    Username should be: root
    No password. Hope that helps.

    ------------------
    Hartmann
  4. #3
  5. Contributing User
    Devshed Novice (500 - 999 posts)

    Join Date
    Feb 2000
    Location
    Perth West Australia
    Posts
    757
    Rep Power
    15
    $db = mysql_connect("localhost","virtual");
    mysql_select_db("pqr",$db);

    or try substituting 'root' for 'virtual' - one of them should work.

    ------------------
    Simon Wheeler
    FirePages -DHTML/PHP/MySQL
  6. #4
  7. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jul 2000
    Posts
    33
    Rep Power
    15
    Thanks, it's working. Great Help.

IMN logo majestic logo threadwatch logo seochat tools logo