TheDemoSite.co.uk  sample code: ASP and MySQL - PHP and MySQL - PHP and MsSQL - phpFormMailer - ASP Contact form  

PHP code examples with database connectivity

PHP code examples with database connectivity
PHP and MySQL
sample code

Just examples of PHP code, linking to your MySQL database and JavaScript.
1. Home | 2. The Database | 3. Add a User | 4. Login | 5. Get your db online

PHP code examples with database connectivity

2. The Database

 

The MySQL database (you will need a MySQLi host also this host provides PHP PDO hosting) used for this example has a simple three field table named members.  The SQL query used to create the table is shown below:

CREATE TABLE members (
id INT NOT NULL AUTO_INCREMENT PRIMARY KEY,
password VARCHAR(12) NOT NULL,
username VARCHAR(12) NOT NULL,
index(password),
index(username))

As can be seen above the "id" is the primary key and is auto incremental.  The "username" and "password" fields are both indexed and must have a value to enter a valid record.  Now add a User to this table.

 


Simple DB app
start your own web reseller business
eprint.com


ac.uk web hosting
UK academic domain names and web hosting
AcHost.co.uk


 



TheDemoSite.co.uk is a MySQL database and PHP FREE code example site hosted with:
Seiretto UK web hosting Copyright © 1996-2014 Seiretto.  All rights reserved.

sample code: ASP and MySQL - PHP and MySQL - PHP and MsSQL - phpFormMailer - ASP Contact form