How to check if Insert query succeeded in PHP

check-database-query-success-php

Here is another post to help out PHP beginners. So you created your connection object, wrote your query, created a statement object, bound your variables to protect yourself against injection attacks etc. Now you execute your query and wanna see if

Read More How to check if Insert query succeeded in PHP

How to detect which button was clicked and which button submits form data in PHP

detect-which-button-clicked-php

This is will a PHP basics posts. I see this question is asked a lot by the beginners so here it goes. Let’s see how you can detect which button was clicked in a PHP form. Detecting Which Button was

Read More How to detect which button was clicked and which button submits form data in PHP

String Concatenation in Ruby

There are various ways that you can do string concatenation in Ruby: 1- Concatenate using “+” operator

2- Concatenate without the “+” operator

3- Concatenate using “<<” operator

4- Concatenate using “concat” method

5- Create an

Read More String Concatenation in Ruby

Difference Between Relative, Absolute and Fixed Positioning

If you are a web developer/webmaster, it is imperative that you understand positioning and know how relative, absolute and fixed positioning works. In this post, I will try to briefly explain how they work so that you can see the

Read More Difference Between Relative, Absolute and Fixed Positioning

Difference Between Hashing and Encryption

When it comes to security, you will hear a lot of people talking about things like hashing and encryption. But what are they? What are the differences? What are the practical approaches when it comes to choose which one to use? In

Read More Difference Between Hashing and Encryption

PHP Prepared Statements – Part 2

I have already written a post titled “Php Prepared Statements” but it was very brief and did not explain the workings of Prepared Statements, neither did it mention the PROS of using Prepared Statements. In this post, I want to provide

Read More PHP Prepared Statements – Part 2

PHP Shorthand IF Statements (Ternary Operator)

You know If statements. They are almost all the same in most of the programming languages. In PHP, their structure is also just the way you would expect them to be 🙂 Below is a very simple if statement in

Read More PHP Shorthand IF Statements (Ternary Operator)

Using Transactions in PHP

Transactions… They are an essential part of programming if you are performing dependent database operations. By dependent database operations, I mean something like this scenario: A) Add a record to table b B) Add a log for this addition operation

Read More Using Transactions in PHP

Maximum Hash Cost Your Server Can Efford for PHP password_hash Method with Blowfish Algorithm

Hashing…Why do we need it? We need it to stop bad guys from stealing the passwords of our users in case they are able to steal our database records. PHP 5.5 has a native password hashing API that you can use for

Read More Maximum Hash Cost Your Server Can Efford for PHP password_hash Method with Blowfish Algorithm

Php Script to Apply Regex Replace on MySQL Records

Use this script at your own risk. Never run scripts on your databases before backing them up! Recently I needed to apply REGEX replacement on my posts in this blog. I wanted to remove dead links from my posts to improve

Read More Php Script to Apply Regex Replace on MySQL Records