Skip to content

Instantly share code, notes, and snippets.

View IbraheemSalem's full-sized avatar

Ibarheem Salem IbraheemSalem

View GitHub Profile
<?php
include('connect.php');
//insert data into database
if(isset($_POST['save'])){
$name=$_POST['name'];
$age=$_POST['age'];
$target="images/".basename($_FILES['image']['name']);
$sql="INSERT INTO image(name,age,image)VALUES('$name','$age','$target')";
$stmt=$con->prepare($sql);
$stmt->execute();
<?php
include('connect.php');
if(isset($_POST['search'])){
$key = $_POST['search'];
$stmt = $con->prepare("select * from users where username like '%$key%' or phone_no like '%$key%'");
$stmt->execute();
$user_details = $stmt->fetch(PDO::FETCH_ASSOC);
if($stmt->rowCount()>0)
{
$output['success'] = '<table class="table table-bordered">