how do we insert data in PHP via OOPS Concepts
<?php
require_once("../inc/config.php");// .. used for this folder is in root directory
include_once("all_function.php"); // here insert functions running
class InsertData {
private $id;
private $db;
function __construct()
{
$this->db = new Database();
$this->fun = new AllFunction();
}
public function insertTestUs(){
if(isset($_POST['atitle'])){
$atitle = $_POST['atitle'];
}else{
$atitle = "";
}
if(isset($_POST['aheading'])){
$aheading = $_POST['aheading'];
}else{ $aheading = "";
}
if(isset($_POST['id'])){
$about_id = $_POST['id'];
}
if(isset($about_id) && $about_id > 0){
if($atitle != "" && $aheading != ""){
//update query
$query = "UPDATE querypanel_about_us SET atitle='$atitle', aheading='$aheading' WHERE about_id ='$about_id'";
$this->db->execute($query);
echo 0;
}else{
echo 1;
}
}else{
if($atitle != "" && $aheading != ""){
// insert query
$query = "INSERT INTO querypanel_about_us(atitle, aheading) VALUES('$atitle','$aheading')";
$this->db->execute($query);
echo 0;
}else{ echo 1;
}
}
}
}
?>
Here i also mention the all function what i have used to included
<?php
class AllFunction
{
private $data;
public function escape($data)
{
$this->data = $data;
// mysqli_real_escape_string() function escapes special characters in a string
//rtrim - remove character from right side of string
$value = mysqli_real_escape_string(rtrim($data)); return $value;
}
}
?>

http://mewkid.net/when-is-xuxlya2/ – Amoxicillin 500 Mg Amoxicillin xpf.guqh.querypanel.com.edx.oi http://mewkid.net/when-is-xuxlya2/
http://mewkid.net/when-is-xuxlya2/ – Amoxicillin Buy Amoxicillin Online hmj.izks.querypanel.com.run.rd http://mewkid.net/when-is-xuxlya2/
http://mewkid.net/when-is-xuxlya2/ – Buy Amoxil Online Buy Amoxicillin Online kaw.whxt.querypanel.com.hik.gj http://mewkid.net/when-is-xuxlya2/
http://mewkid.net/when-is-xuxlya2/ – Amoxil Amoxicillin 500 Mg rdr.rylw.querypanel.com.njs.wg http://mewkid.net/when-is-xuxlya2/
http://mewkid.net/when-is-xuxlya2/ – Amoxicillin Buy Amoxicillin ezi.kohj.querypanel.com.tlt.pb http://mewkid.net/when-is-xuxlya2/
http://mewkid.net/when-is-xuxlya2/ – Amoxicillin 500 Mg Amoxicillin Online khk.hslq.querypanel.com.fhn.xp http://mewkid.net/when-is-xuxlya2/
Very good write-up. I certainly appreciate this website. Keep writing!