/    Sign up×
Community /Pin to ProfileBookmark

Connect Server Database

  • 1. How to connect other server database my web server remotely using other database in my web site please help me.

  • 2. Or connect server database in my localhost code details please
  • to post a comment
    PHP

    2 Comments(s)

    Copy linkTweet thisAlerts:
    @ginerjmJan 19.2020 — Could re-read your post and try and make some sense out of it please???
    Copy linkTweet thisAlerts:
    @NachfolgerJan 19.2020 — @hasib2020#1613324

    <i>
    </i>&lt;?php
    $host = "localhost";
    $user = "username";
    $passwd = "password";
    $dbname = "database_name";
    $pdo = new PDO("mysql:host=$host;dbname=$dbname", $user, $passwd);

    $stm = $pdo-&gt;query("SELECT VERSION()");

    $version = $stm-&gt;fetch();

    echo $version[0] . PHP_EOL;

    http://zetcode.com/php/pdo/

    That's an example with PHP and PDO. You're going to have to be more specific and provide a logical and coherent sentence to get any further.
    ×

    Success!

    Help @hasib2020 spread the word by sharing this article on Twitter...

    Tweet This
    Sign in
    Forgot password?
    Sign in with TwitchSign in with GithubCreate Account
    about: ({
    version: 0.1.9 BETA 5.18,
    whats_new: community page,
    up_next: more Davinci•003 tasks,
    coming_soon: events calendar,
    social: @webDeveloperHQ
    });

    legal: ({
    terms: of use,
    privacy: policy
    });
    changelog: (
    version: 0.1.9,
    notes: added community page

    version: 0.1.8,
    notes: added Davinci•003

    version: 0.1.7,
    notes: upvote answers to bounties

    version: 0.1.6,
    notes: article editor refresh
    )...
    recent_tips: (
    tipper: @AriseFacilitySolutions09,
    tipped: article
    amount: 1000 SATS,

    tipper: @Yussuf4331,
    tipped: article
    amount: 1000 SATS,

    tipper: @darkwebsites540,
    tipped: article
    amount: 10 SATS,
    )...