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

Query results from a Database Using PHP MySqli

In order to Query results from a Database Using PHP MySqli make sure that you have the following steps taken care of.

  1. You Created A Database
  2. You Granted Privileges to the database
  3. Created a config.php file to access the database
  4. Make sure you Connect to a Database before using this code.
  5. Make sure there are entries in the database your are trying to call from!

Query results from a Database Using PHP MySqli

Now take the following code to query results from a database. Replace the X’s with whatever table row you are trying to fetch.

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. 🙂
  $result = $db->query("SELECT * FROM XXX") ;

while ($row = $result->fetch_assoc()) {
echo $row['XXX'];
}
Query results from a Database Using PHP MySqli was last modified: May 6th, 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

Tips

Cool People Share:
Query results from a Database Using PHP MySqli

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.