This tutorial is going to show you how to retrieve results from a database using PHP, then edit the row and save it back to the database. If you haven’t followed our other tutorials you might want to check out: Reading from a MySQL Database Using PHP and MySQLi Inserting Data Into a MySQL Database … Read more
This tutorial will show you how to insert data into a MySQL database using the latest MySQLi PHP libraries. This tutorial will replace our older tutorial on MySQL libraries and that post will redirect here in the future. Assumptions First, we will assume you have PHP, MySQL, and Apache running. I use MAMP for my … Read more
I had some old tutorials out there that use outdated PHP libraries to access a MySQL database. I wanted to update these to use the latest PHP library called MySQLi. MySQLi is the improved database driver for use in the PHP scripting language to provide an interface to MySQL databases. It replaces both PHP’s MySQL … Read more
Recently while working on a project, I found myself needed to parse several different types of files through the same mechanism (CSV, pipe delimited, XML, and more). I decided that it would be best to get each time of feed to a identical object that could then be run through the same methods regardless of the input type. This tutorial will walk you through using PHP and XPath to parse the values from an XML file and store them into array for later manipulation.
This tutorial will show you how to access a mysql database using the PHP Data Objects interface, also known simply as PDO. One big advantage of using PDO versus other methods is the use of prepared statements which offers much better security than the mysql or mysqli libraries. Also PDO can connect to several different … Read more
This tutorial will show you how to use jQuery to allow as list (UL) to be reordered and will also make an AJAX call to a PHP file that will update the database when an item is dropped. I found this useful for a project I was working on recently. The user wanted to be able to change the order that categories displayed in a report. The items are stored in a database with a field called display_order. When the report is generated we simply order by that field.
In on of our last tutorials we covered how to verify that a user’s email address is formatted correctly as well as verify that it goes to a valid domain name. That is great, but still not a great way to make sure a user actually owns or uses that e-mail address. This tutorial will walk you through one method of sending the user an e-mail upon signing up that gives them a link to activate their account.
In this tutorial you will learn a simple way to parse CSV files using PHP and output the text of the fields you need. This tutorial is not going to go into what you can do with the data once you get it from the CSV as the possibilities are endless. We will simply show you how to get the data into an array in PHP.
This tutorial will walk you through checking for an e-mail to be valid as the user is filling out the form without having to reload the page.
This question has been asked several times lately and I wanted to clear this up. This is a very easy concept once you get it down. In order to display the results from a MySQL query into a table will will store the results in an array and then echo out each row in a while loop.
We have had a few tutorial that show how to display and add data to a MySQL database. Now I am going to show you how to edit a row in your database. In previous examples we setup a table whcih contains: ID, FName, LName and PHON. We will be retreiving the data, making changes, then updating the row in the database. This tutorial is design for the user to update there own information so we will only be editing row for this user.
Every wonder how all of those dating ads know that you are looking for hot girls near (insert your city here)? Well if you are a complete nerd like me you probably ignored the hot girls and wondered: “How did they know where I live?”. There are a few simple ways to do this. Today … Read more