DEV Community

Cover image for Parameter Binding in PHP – Examples and Discussion
Aritra Mukherjee
Aritra Mukherjee

Posted on β€’ Originally published at geekyminds.co.in on

1 1

Parameter Binding in PHP – Examples and Discussion

🎯 In this article, we are going to look into four basic examples of Parameter Binding in PHP using both MySQLi and PDO! I have accumulated these from my own projects and various corners of the web. They will help you get started with Parameter Binding in PHP if you happen to find to it tricky to use, just like I did.

πŸ’‘ If Parameter Binding does not tell you anything, you may want to check out my previous article where I explained how Parameter Binding can be used for deterring most SQL Injection attacks in PHP.

Just like the previous article, I am going to show you how to use both MySQLi and PDO step by step. This way, people who are comfortable with MySQLi will be able to learn PDO easily and vice versa.

Here's what I'll cover:

  • Creating the MySQLi and PDO Objects
  • Example 1: Single Parameter Binding
  • Example 2: Mulitple Parameter Binding
  • Example 3: Reusing Query with Parameter Binding
  • Example 4: Implementing Basic Search With SQL LIKE

Continue reading "Parameter Binding in PHP – Examples and Discussion"

The post Parameter Binding in PHP – Examples and Discussion appeared first on GeekyMinds.

Postmark Image

Speedy emails, satisfied customers

Are delayed transactional emails costing you user satisfaction? Postmark delivers your emails almost instantly, keeping your customers happy and connected.

Sign up

Top comments (0)

Billboard image

The Next Generation Developer Platform

Coherence is the first Platform-as-a-Service you can control. Unlike "black-box" platforms that are opinionated about the infra you can deploy, Coherence is powered by CNC, the open-source IaC framework, which offers limitless customization.

Learn more

πŸ‘‹ Kindness is contagious

Please leave a ❀️ or a friendly comment on this post if you found it helpful!

Okay