I am creating an internal extension directory using html. How do I connect html to mysql database so as to be able to retrieve the extension number of the person I am looking for.

3 Years
Discussion Span
Last Post by Tonderayi

You cannot use HTML to connect to MySQL, the closest you can get is the PHP (Hypertext Preprocessor). I assume you're running Windows. You would need Apache server for this. I personally would recommend installing XAMPP, which has MySQL and Apache server in it. After all installation, at the end you will be asked whether open "Control Panel", makes sure that the box is checked and the panel will open, start Apache and MySQL servers. After this, go to: C:/xampp/htdocs/ create folder projects, in there, make a file called config.php, open this file with your favourite editor (let it be Notepad++, Brackets, SublimeEditor, Microsoft Notepad) and in there, copy this:

    $sql_un = "root";   // default: "root";
    $sql_pd = "";       // default: "";
    $sql_db = "";       // you will need to create database and input here it's name
    $sql_conn = mysqli_connect("", $sql_un, $sql_pd, $sql_db);

    if (!$sql_conn) {
        die("Something didn't work, the file couldn't connect to database!");
    echo "File's request has been successfully sent and answer received.";


If you need further assistance with phpMyAdmin, or Apache server. Feel free to ask.

Edited by Aeonix

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.