Close Menu

    Subscribe to Updates

    Get the latest creative news from FooBar about art, design and business.

    What's Hot

    Zoho Projects: Key Features and Overview

    October 27, 2025

    Zoho CRM Comprehensive Overview

    October 27, 2025

    Zoho Desk: Guide and Comparison

    October 27, 2025
    Facebook X (Twitter) Instagram
    Tech How To DoTech How To Do
    • Tech News
    • Home
    • Windows
      • Windows Server
    • Apple
    • Linux
    • WWW
      • E-commerce
      • Shopfiy
    • Mobile
      • Android
      • iOS
    • Cloud
    • Office
    • Tech Tips
    • Gaming
    • HRMS
      • Admin
      • Employee
    Tech How To DoTech How To Do
    Home»Tech Tips»How to Access Data from WordPress Databases
    Tech Tips

    How to Access Data from WordPress Databases

    Ahmad LatifBy Ahmad LatifAugust 4, 2020Updated:October 27, 2025No Comments3 Mins Read
    Facebook Twitter Pinterest Telegram LinkedIn Tumblr WhatsApp Email
    Share
    Facebook Twitter LinkedIn Pinterest Telegram Email

    This Article will describe how to create and access Data from WordPress Databases. For this purpose, you have at least one user following is the procedure how to do it.

    Login to your cPanel and in Database section click on MySQL Database wizard.

     

    Enter name of database and click Next Step.

     

    Your database is created now in this step set user for database enter details and must remember the password, click Create User.

     

    Check the privileges you want to give to user if you want to give full access check ALL PRIVILEGES and click Next Step.

     

    User is added to Database now click return to MYSQL Databases.

     

    Here you can see your database from here you can rename or delete your database.

     

    If you want to change user’s password scroll down and click change password, you can also rename or delete the user as well

     

    Now connect your database with your page goto cPanel dashboard in Files section click on file manager.

     

    In file manager look for public_html folder.

    To create your connection file, click on create +File on left corner.

     

    Enter your filename with extension .php and click create new file.

     

    Once your file is created right click on it and select Edit.

     

     

    Click on edit.

     

    This is your editing screen here you will write your connection code.

     

    Following is the code how to connect webpage to database, make sure that enter correct details.

    <?php

    $st=mysqli_connect(‘server name’,’db username’, ‘user password’, ‘databasename’);

    If($st)

    {

    echo “Connected”;

    }

    else

    {

    echo “Not Connected”;

    }

    ?>

     

    Now to check connection is established or not go to cPanel and look for primary domain.

     

    Copy this link and paste in address bar and enter your filename after domain e.g. http://aiitsolutions.com/filename.php and press enter, if it say connected so its mean your connection is established.

     

    Now add dummy data into your database for this goto cpanel dashboard , in Databases section  click phpMyAdmin.

     

    Now select your database.

     

    Enter table name and select how many columns you want then click go.

     

    Provide details and click save.

     

    Table is created to insert data click in Insert.

     

    Enter details and click go.

     

    If query will run successfully following message will appear.

     

    Now for retrieving data from database to your page go to publicl_html folder and open your page in editor and write code for retrieving data and display it.

    <?php

    $st=mysqli_connect(‘server name’,’db username’, ‘user password’, ‘databasename’);

    If($st)

    {

    $sql   =” SELECT* FROM exptable”;

    $result =myslqi_query($st,$sql);

    If(mysqli_num_rows($result)> 0)

    {

    while($row=mysqli_fetch_assoc($result))

    {

    echo “id:” .$row[“id”]. “-Name : ”. “ “ . “<br>”;

    }

    } else

    { echo “0 results”;}

    }

    else {

    echo” Not”;}

    ?>

     

     

    Now you can see your entered data on page.

    This how you can create and access Data from WordPress Databases.

    cpanel database php wordpress
    Share. Facebook Twitter Pinterest LinkedIn Tumblr Email
    Ahmad Latif
    • Facebook
    • X (Twitter)

    Ahmad has 9 years of experience in Graphic design, IT Help-desk and Network Support Agent. He worked with multinational companies to provide IT-solutions/Troubleshoot to end users. He has experience supporting 32 global offices and was a part of the team having offices in Pakistan, Philippines, and India. He has hands-on experience Leading teams, Training Global teams, Incident management, Service desk Projects Management, Virtual Infrastructure Setup/Management, Office365, Window Azure, CISCO IP Phones, Reporting, and many of Adobe products.

    Related Posts

    Zoho Projects: Key Features and Overview

    October 27, 2025

    Quantum Computing: Transforming Technology and Everyday Life

    October 28, 2024

    Automate Ticket Creation in Zoho Desk from Incoming Emails

    October 23, 2024

    Host Your Static Website on Cloudflare Pages with Custom Domain

    October 21, 2024

    Why Gaming in Workplace Boosts Productivity

    October 9, 2024

    MovieGen: Meta’s Groundbreaking AI Model Can Create Videos from Text

    October 7, 2024

    Comments are closed.

    Recent Posts
    • Zoho Projects: Key Features and Overview
    • Zoho CRM Comprehensive Overview
    • Zoho Desk: Guide and Comparison
    • Change your SharePoint domain name
    • HRMS Assets Module: Features, Management, and User Guide
    Categories
    • Android
    • Apple
    • Beauty
    • Building
    • Business
    • Construction
    • Design
    • Education
    • Fashion
    • Food
    • Games
    • Health
    • Lifestyle
    • Mobile
    • Nature
    • News
    • Photo
    • Politics
    • Sports
    • Tech News
    • Tech Tips
    • Technology
    • Travel
    • Video
    Tags
    Business Case Study Creative Education Insights SEO Marketing Solutions
    © 2025 Tech How To Do. Develop, Designed and Maintained by AIIT SOLUTION
    • Home
    • Tech
    • Gadgets
    • Mobiles
    • Buy Now

    Type above and press Enter to search. Press Esc to cancel.

    Ad Blocker Enabled!
    Ad Blocker Enabled!