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.

[code] $result = $db->query("SELECT * FROM XXX") ;

while ($row = $result->fetch_assoc()) {
echo $row[‘XXX’];
}[/code]

Only cool people share!

Query results from a Database Using PHP MySqli was last modified: May 6th, 2015 by Maximus Mccullough
Summary
Query results from a Database Using PHP MySqli
Article Name
Query results from a Database Using PHP MySqli
Description
Query results from a Database Using PHP MySqli Created Database, Granted Privileges Created a config file, connect to database, entries exist
Author
Query results from a Database Using PHP MySqli

Leave a Reply

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