PHPTechnology

MySQL fi PHP wal qunnamsiisuu

Maxxansa koo kan kanaan duraa keessatti akkaataa php fi mysql wal qunnamsiisuu danda’an karaalee lamaan tokko waliin ilaaluun keenya ni beekkama. Maxxansa kana keessatti immoo, tooftaa pdo(php data object) jedhamu gargaaramuun, php fi mysql wal qunnamsisuun danda’amu wajjiin ilaalla. Mee koodii xiqqoo armaan gadii kanaan haa ilaalluu!!

 <?php
$servername = "localhost";
$username = "username";
$password = "password";

try {
    $conn = new PDO("mysql:host=$servername;dbname=myDB", $username, $password);
    // pdo'n rakkoo dhufuuf akka qophaayu gochuu
    $conn->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
    echo "Qunnamtiin Milkaaye";
    }
catch(PDOException $e)
    {
    echo "Ooh, yaaliin kee hin milkoofne: " . $e->getMessage();
    }
?>

Koodii kana gargaaramuudhaan MySQL fi PHP wal qunnamsiisuu dandeessu.

 

Show More

Alifu Haji

I am cofounder of this blog and a passionate blogger. I loves to share what i know with others. I usually writes about technology, health, entertainment and bla bla. Please, stay connected with me!!

Related Articles

Leave a Reply

Your email address will not be published. Required fields are marked *

Check Also

Close
Close

Adblock Detected

Please consider supporting us by disabling your ad blocker