1 Star2 Stars3 Stars4 Stars5 Stars (18 votes, average: 5.00 out of 5)

Retrieving Data From MySql with PHP

Retrieving data from MySql with PHP is a simple process however you should have the following things set up before implementing this process.

  1. You Created A Database
  2. You Granted Privileges to the database
  3. Created a config.php file to access the database

After you insert data into a database you will eventually need to be retrieving data from MySql with PHP. Here is a code that you can use for that.

Tip: Click on images to make them larger. If you find anything wrong on this page or need further assistance please comment below or contact me. 🙂

Code For Retrieving Data From MySql with PHP



$con = new mysqli("$host", "$username", "$password", "$dbname");

$result = $con->query("SELECT * FROM TABLE") ;

while ($row = $result->fetch_assoc()) {
echo $row['row-name'];



Retrieving Data From MySql with PHP was last modified: October 18th, 2015 by Maximus Mccullough

Subscribe To My YouTube Channel:

Please like, share and subscribe.

Advanced Programming Made Easy

I hope you enjoyed the article. If I was able to help you please consider a tip for the content.

One Time Tip

more tips

Reoccuring Tips


Cool People Share:
Retrieving Data From MySql with PHP

Leave a Reply

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

This site uses Akismet to reduce spam. Learn how your comment data is processed.