Skip to content

Instantly share code, notes, and snippets.

View sumitpal2910's full-sized avatar
🎯
Focusing

sumit paul sumitpal2910

🎯
Focusing
  • india
View GitHub Profile
@arsho
arsho / pdo_like.php
Created May 20, 2017 05:00
Like operator in PDO
<?php
$user = "root";
$password = "";
$name = "%o%";
try{
$conn = new PDO('mysql:host=localhost;dbname=test_db',$user,$password);
$query = "SELECT * FROM `test_table` WHERE `name` like :name";
$stmt = $conn->prepare($query);
$stmt->bindParam(':name',$name);
$stmt->execute();