Dynamic SQL Queries

One use of PHP is to create a connection to a MySQL database, use a query to select some data, display or loop through it. In the previous tutorial, we looped through some data which was provided to us using a static SQL query.

Related Tutorials
SQL Theory & How-To
This article addresses two SQL-related issues in PHP: 1) Creating complex, powerful, queries to take advantage of your table schemas, and 2) Building those queries on the fly according to user input.
Paginating Results with MS SQL
In my last post, I showed you just how simple it is to retrieve paginated results using MySQL. Unfortunately, MS SQL doesnt utilize the LIMIT command and doesnt implement any easy way to retrieve paginated results. Instead, you actually have to run three nested queries with MS SQL in order to retrieve a specific subset of results. MS SQL supports a clause called TOP rather than LIMIT and the TOP clause only accepts a single parameter.
Sending queries to mySQL
PHP send quesries to mySQL using mysql_query function. mysql_query function returns boolean (True or False) value which your quesry does not return any records. Queries (sql statements) like SELECT, SHOW, DESCRIBE, EXPLAIN return false value on error. If query is true, returning value must pass to mysql_fetch_array().
Create dynamic sites with PHP & MySQL
This tutorial shows you how to use two open source, cross-platform tools for creating a dynamic Web site: PHP and MySQL. When we are finished, you will know how dynamic sites work and how they serve the content, and you will be ready to serve your own dynamic content from your site.
Website security protection - Prevent avoid SQL injection
Protect your website from SQL injection with PHP. Preventing SQL injection is not difficult but very important/ SQL injection is very dangerous but can be very easily prevented. In this post I will show you how to prevent hackers attacks on your website.
Sanitising and Cleaning Variables
sanitising or cleaning a variable is standard practice to ensure that a variable used within a page or even within a dynamic SQL query is clean from any nasties which would cause harm to the script or database.
Dynamic URLS using php and mysql
To create dynamic URL with php and mysql is quite simple and this small tutorial will teach you how very easily. If you look at Chipmunk directory, board, or CMScore, you will find that they all use Dynamic URLs with PHP/Mysql.
Dynamic (2 level) navigation list
The creation of a dynamic nested unordered list without using any JavaScript code is sometimes a problem because the script needs to "remember" the values, sub values and also the query string from previous clicked links. In this tutorial we will learn how to create a dynamic navigation menu powered by PHP and MySQL only. While using standard HTML elements (unordered lists) it's easy to add different CSS styles later.
Building a dynamic drop down menu
Use the power of PHP and CSS to build dynamic drop down menus.
Dynamic website using php part-1
In this first part of the dynamic website tutorial I will teach you how to organize your files to create a simple file structure using includes, we will also apply our first styles to our site.
 
Categories