Tutorials

This time you will learn how to insert, update and delete rows using PDO. Prepared statements quote and escape strings for you so there's no worry about SQL injections. Insert a new row To insert a row, you need to have all the data first. You can use PHP variables to fill in data. When you insert the data, the order has to be the same.

Posted by in MySQL

Recently, I changed this site from MySQL to PDO, and you should do the same. MySQL is depreciated and will be removed from PHP in the near future. PDO stands for PHP Data Objects and it uses Object Oriented Protocol to connect to databases. PDO vs MySQLi MySQLi is useful and easy to learn, but once you master PDO, you will never want to go back.

Posted by in MySQL

Today's tutorial shows how to create a plugin to highlight table data. Code Copy this code into a JavaScript file and include it in your page, after jQuery. (function($) { $.fn.highlight = function() { return this.each(function() { var table = $(this); var cell = table.find('td'); cell.

Posted by in JavaScript

This tutorial will show you how to create an element that will scroll with the browser after a certain amount of scrolling. CSS First of all, we need to make a class with a fixed position. A fixed position means that element will always scroll with the browser. .sticky { position:fixed; top:0; } JavaScript The above code works if you want that element to always scroll, but sometimes you want to stick after a certain amount.

Posted by in JavaScript

Today's tutorial will be how to create your own jQuery plugin. What can you do in a plugin? Anything you can normally do with JavaScript. Why create a plugin when I have custom functions? You can put a plugin into a giant function, but it gets really messy. It's like classes in PHP, or good folder structure with your files on your computer; it's just more organized.

Posted by in JavaScript