Using Prepared Statement with PHP and MySQL
In the previous tutorial, we used mysqli API that comes with PHP to query a MySQL database. In this tutorial, instead of sending a SQL query statement, we are going to use prepared statement to...
read moreUpdating MySQL with PHP using mysqli
This tutorial continues directly from the last tutorial where we inserted an record. Now we will update the record that was just inserted. Adding to the previous code, we construct an MySQL...
read moreUsing mysqli to insert to MySQL database
In previous tutorial, we will saw how to query from MySQL database, now we use mysqli to insert to the “example” table of the a MySQL database. Like before, we call mysqli_connect with...
read moreHow to Delete a file in PHP
In the last tutorial, we wrote to a log file called “log.txt” in PHP. Now we use PHP to delete this file. Simple do… unlink(‘log.txt’); in PHP. And the file will...
read moreTutorial on How to Write to a File in PHP
In this tutorial, we will show you how to write to a log file in PHP. Here is a basic function we called “writelog” which takes a $msg message string to be written into a log file...
read moreTutorial using PHP to Query MySQL
In this tutorial, we will use PHP to query a MySQL database. For the purpose of this example, suppose we want to query the last 5 posts from a WordPress MySQL database. We will need to know the...
read moreFile Upload in PHP Tutorial
In this tutorial, we will build a file upload form in PHP to upload an image file to the web server. In the process, we will perform a few security checks to prevent file upload abuse. 1. Start...
read moreUsing Random Form Token to Help Protect Against CSRF
Suppose we have the following form in index.php … that will POST to do.php to do something. To help protect against CSRF (cross-site request forgery), in do.php we have to make sure that it...
read moreHow to Create a Right-Click Menu using JQuery
In this tutorial, we will create a right-click menu (better known as a context menu) that will come up when you right-click on the page … For Mac, you would do Ctrl-Click, since Mac mouse have...
read moreAll contents are opinions and are copyrighted and may contain display ads and ad links for which site may receive revenues from.
See Terms of Use and Privacy Policy.