MYSQL

How To Insert Data in to a MySQLi Database through PHP

Submitted by Yorkiebar on
Introduction: This tutorial will be on allowing users to input data in to an HTML form, and then upload that data to a MySQL database through PHP. HTML: First we need our HTML form. This example will just be for a user to enter their username and email address, we will not do any validation or username checking (to assure no duplicate usernames within our website) as this is not the purpose of this tutorial.

Use DateTime Stamp Appropriately in PHP/MySQLi

Submitted by Yorkiebar on
Introduction: This tutorial is on how to use timestamps properly in PHP and MySQLi to sort information from databases in to the correct order. What's a Timestamp? A timestamp is a data type in PHP and MySQL(i) which is used to hold the correct format of a specified date, time, or date and time together. Database: To enable a database table to hold a timestamp we can first create a database, named 'fln', then create a table named 'test', and give it the following column structure... id, int, 5 length, primary key, auto increment date, dateti

Registering Via IP (Continuation) in PHP/MySQLi

Submitted by Yorkiebar on
Introduction: This tutorial is on how to allow our users register via their unrecognised IP (Continued from http://www.sourcecodester.com/php/7539/auto-recognise-users-ip-address-through-phpmysqli.html). Important: I highly recommend that you read through the linked tutorial above, it will allow you to get the same source I am going to be using throughout this tutorial! Validation: So before we

Auto Recognise Users via IP Address Through PHP/MySQLi

Submitted by Yorkiebar on
Introduction: This tutorial will show you how to quickly identify your website users through their IP. Database: First we will need a database (mine is 'fln'), a table - 'test', and columns with data. My columns are; id, int, 5 length, primary key, auto increment username, varchar, 255 length ip, varchar, 255 length The IP field does not have to be 255 characters long but it will help to avoid

Retrieving Specific Data in MySQL/PHP

Submitted by Yorkiebar on
Introduction: This tutorial is on how to retrieve specific data from a database through PHP and MySQL/MySQLi. Latest: In my latest tutorials I have shown how to retrieve all rows from a database table, how to insert data, and how to validate data. Now I will show you how to retrieve specific data through slightly more advanced queries. Database: First you will obviously need a database with table

Validating and Inserting User Data in PHP/MySQL(i)

Submitted by Yorkiebar on
Introduction: This tutorial is on how to take user input, check it against a database, and insert if it is not already present. This could be used for registration in terms of unique usernames. Database: First we need a database with one table. My database is called 'fln', table is called 'test', and it has two fields: id, int, 5 length, primary key, auto increment. username, varchar/string, 255

Inserting Data in PHP/MySQL

Submitted by Yorkiebar on
Introduction: This tutorial is going to be on how to insert data in to a MySQL table through PHP. This is in companionship with my 'How To Retrieve Data' tutorial found here (http://www.sourcecodester.com/php/7510/retrieving-data-mysqlphp.html). 'Insert': To insert data in to a MySQL table, we have to use the 'INSERT' keyword command in our query statement. Steps: First we need to create the data

Sorting Data in PHP/MySQL

Submitted by Yorkiebar on
Introduction: This tutorial will be running off a tutorial found here (http://www.sourcecodester.com/php/7510/retrieving-data-mysqlphp.html) and will be showing you how to sort retrieved data. An example of how this could be used is in the leaderboards of a game. Table Modifications: First I need to modify my table from the previous 'Retrieving Data' tutorial. I am going to add a second column