One of the defining features of PHP is the versatility it offers for connection to, and manipulation with, databases. In this article, we look at some features of the PHP and MySQL combination. We shall go through the following steps:- Connect to MySQL Database Server
Create new Database
Select MySQL Database
Add data to table
Retrieve data
Error Handling
FreeVersion: 1.0.0 Platform(s): linux, windows, freebsd, sun Updated: Fri Feb 29 2008
If your website some how gets hacked and you lose all your MySQL Database information, I doubt you would be laughing… or smiling… That's why you need to backup your database from time to time so that you can put it back the way it was. Here is a simple script using PHP and MySQL to backup your database!
FreeVersion: 1.0 Platform(s): linux, windows, freebsd, osx, sun Updated: Tue Jun 24 2008
In some recent work I needed to have databases created with a back end application. Once the database was created from this online application it was pre filled with tables and data from another script that ran right after the database was made. To create a database with PHP we first need to connect as a user that has the ability to create new databases...
FreeVersion: n/a Platform(s): linux, windows, freebsd, osx, sun Updated: Sun Mar 23 2008
This is a guide aimed at getting phpMyAdmin installed on your server in very little time. It covers all the basics, and should get phpMyAdmin running on most servers.
In this tutorial I will show you how you can create an object oriented database abstraction class for MySQL database. Besides the basic functions this manager class can summarize total time spent with db connection and query execution and counts how many query were executed during your PHP script.
FreeVersion: 1.0 Platform(s): linux, windows, freebsd, osx, sun Updated: Fri Nov 2 2007
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().
FreeVersion: 1 Platform(s): windows Updated: Fri Jan 11 2008
Sometimes it could be very helpful to select a record from a table randomly.
You can find such solution when you see random partners or randomly selected tutorials.
This tutorial shows you how to select records randomly from a MySQL database.
FreeVersion: 1.0 Platform(s): linux, windows, freebsd, osx, sun Updated: Mon Oct 29 2007
This tutorial might seem pretty simple and obvious for many advanced webmasters, but some beginners might have some problems. And since I remember I was a bit stuck on this years ago too, why not make things clear for anyone?
When do we need to do this? Everytime we install a forum or a CMS that requires an empty database being already created for the install process.
Following code samples, demonstrates how to count records in a MySQL database table. You may send parameters to query to display only selected range of rows.
A collection of 18 FAQs on connecting to MS SQL Server with PHP scripts. Clear explanations and tutorial exercises are provided on SQL Server connection; providing port number; selecting database; running SQL statements; checking execution errors; looping through query result; looping through result fields.
This tutorial will show you how to import csv data into MYSQL with a simple PHP script.
Many times you have to write a script because the import function in phpMyAdmin will not import
the way you want.
FreeVersion: n/a Platform(s): linux, windows, freebsd, sun Updated: Sun Feb 4 2007
SQL injection is a security vulnerability that occurs in the database layer of an application. The vulnerability is present when user input is either incorrectly filtered for string literal escape characters embedded in SQL statements or user input is not strongly typed and thereby unexpectedly executed. It is in fact an instance of a more general class of vulnerabilities that can occur whenever one programming or scripting language is embedded inside another.
PHP usually comes with mysql extension mysql (mysql_... functions) which is rather low-level and requires writing too much code for a trivial tasks: error-checked execution of SQL queries, getting single row from SQL table, getting value from SQL table cell, etc. OOP mysqli extension isn't any better. In this article we present 5 useful functions which greatly simplify majority of real-life MySQL operations.
FreeVersion: n/a Platform(s): n/a Updated: Fri Mar 30 2007