Home arrow MySQL arrow The Three Most Important MySQL Queries

The Three Most Important MySQL Queries

Doing PHP queries to a MySQL database is one of the most important processes in any web application. This is where data is being fetched from or inserted into the database. If you are a beginning PHP web developer, then learning the most important MySQL queries is essential to your success in dealing with dynamic websites.

TABLE OF CONTENTS:
  1. The Three Most Important MySQL Queries
  2. The INSERT MySQL Query Command
  3. The SELECT MySQL Query Command
  4. The UPDATE MySQL Query Command
By: Codex-M
Rating: starstarstarstarstar / 27
July 06, 2009

print this article
SEARCH DEV SHED

TOOLS YOU CAN USE

advertisement

You can see dynamic websites almost everywhere on the net. Popular software packages, whether for blogging (like WordPress or Drupal) or e-commerce (such as osCommerce) are configured to be dynamic in nature. Dynamic websites rely on MySQL databases to fetch and insert data coming from and going to the browser.

If you are beginner, understanding the simple diagram below helps you to understand the role of MySQL in today's dynamic websites as compared to the traditional static websites.

In a simple static websites (popular in the old days of the Internet), you would see the following flow of events:

Client browser request for information from the server -> Server returns HTML code to the browser -> Browser displays the HTML, which becomes a web page.

Now, in modern dynamic websites:

The client browser requests a web page, and when the server receives the request, the web template (those files with the extension *.php) executes the PHP scripts that involve fetching information (involving queries) from MySQL (such as your name, password, content, or anything else). The information will then be added to the web template, and then return to the browser as HTML. When you view the source code, you cannot see the PHP scripts any longer, because they have already been executed in the server.

With dynamic websites, you can create a thousand URLs with only one server PHP template stored. But with static websites, you need to store 1000 HTML files in your server to create 1000 URLs (which is very difficult to manage or update). Do you see the difference?

If you know the most important MySQL queries, it will then be very easy to communicate with the database, thus enabling you to create complex PHP web applications. This will save you time and make your website as efficient as possible. In this tutorial, we will illustrate PHP scripts that will query a MySQL database using the basic INSERT, SELECT, and UPDATE commands.



 
 
>>> More MySQL Articles          >>> More By Codex-M
 

blog comments powered by Disqus
escort Bursa Bursa escort Antalya eskort
   

MYSQL ARTICLES

- Oracle Unveils MySQL 5.6
- MySQL Vulnerabilities Threaten Databases
- MySQL Cloud Options Expand with Google Cloud...
- MySQL 5.6 Prepped to Handle Demanding Web Use
- ScaleBase Service Virtualizes MySQL Databases
- Oracle Unveils MySQL Conversion Tools
- Akiban Opens Database Software for MySQL Use...
- Oracle Fixes MySQL Bug
- MySQL Databases Vulnerable to Password Hack
- MySQL: Overview of the ALTER TABLE Statement
- MySQL: How to Use the GRANT Statement
- MySQL: Creating, Listing, and Removing Datab...
- MySQL: Create, Show, and Describe Database T...
- MySQL Data and Table Types
- McAfee Releases Audit Plugin for MySQL Users

Developer Shed Affiliates

 


Dev Shed Tutorial Topics: