Breaking down a function – updateRecords()

A friend asked me to explain this code in detail for a function called updateRecords() that they were studying on an online learning site. Actually they expect you to create the guts of the function yourself and make sure it meets certain requirements. This is my solution and explanation. It is designed for somewhat beginners so Its deliberately not succinct because the purpose is to explain whats going on in detail in a simple way that is easy to follow. At the end I will demonstrate alternative ways to write the same function in a more concise manner.

Continue reading “Breaking down a function – updateRecords()”

Reconciling Return

The return keyword and its purpose is actually fairly simple but for some reason it seems to cause beginners a lot of confusion. Even after being exposed to it by example and explanation, it can take some time before understanding really sinks in. I know this was certainly the case for me but I don’t believe it needed to be that way. Lets see if we can’t help lessen that confusion here.

Continue reading “Reconciling Return”

Basic Toggling with javascript

If your not familiar with natural javascript and your only used to using a library like jQuery, then you might be surprised to learn that javascript doesn’t have a predefined toggle function that you can just call up when you want. You need to create your own before you can use it. Here is a bare bones demonstration of toggling in plain old ordinary javascript.

Continue reading “Basic Toggling with javascript”

PHP MySQL Inserting Records Reference

First up there are three examples for inserting records into a MySQL database, one for each of the three following techniques:

  • Using mysqli in a procedural manner.
  • Using mysqli in an object-oriented fashion.
  • Using PDO.

After that there is an example of the same three approaches, but with the addition of using prepared statements for improved security and efficiency.

Continue reading “PHP MySQL Inserting Records Reference”

The Definitive Guide to Object-Oriented JavaScript

James Shore has a truly excellent video explaining Javascript Objects and the topic of inheritance in detail at http://www.objectplayground.com/. It covers a few other things and is probably one of the very best videos I’ve seen on the subject. I highly recommend it to anyone who wants to further their knowledge of Javascript.

Here’s a few screenshots: