Results 1 to 3 of 3
  1. #1
    Join Date
    Jun 2014
    Posts
    2

    Unanswered: Mysql to Postgresql Connection

    Hi!

    How can I make this direct change in PHP from Mysql to Postgresl

    <?php

    $con = mysql_connect("localhost","root","");
    if (!$con)
    {
    die('Could not connect: ' . mysql_error());
    }

    mysql_select_db("kpi", $con);


    ?>

    Thank you.

    David

  2. #2
    Join Date
    Feb 2004
    Location
    In front of the computer
    Posts
    15,579
    Provided Answers: 54
    This is really a PHP problem, so I moved the message thread within DBForums from the MySQL forum to the PHP forum.

    -PatP
    In theory, theory and practice are identical. In practice, theory and practice are unrelated.

  3. #3
    Join Date
    Jan 2007
    Location
    UK
    Posts
    11,434
    Provided Answers: 10
    PHP: PostgreSQL - Manual

    mysql_connect = PHP: pg_connect - Manual

    mysql_select_db = see previous link. You specify the database name in the connection string.
    George
    Home | Blog

Posting Permissions

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