Skip to content

Instantly share code, notes, and snippets.

@elmelegy
Created July 19, 2015 13:49
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save elmelegy/1c7521be85148f54c510 to your computer and use it in GitHub Desktop.
Save elmelegy/1c7521be85148f54c510 to your computer and use it in GitHub Desktop.
<?php
class con
{
public $con;
public function __construct(){
$this->con = mysqli_connect('localhost', 'root', '', 'whatsapp');
if($this->con){echo 'Connection <br/>';}else{echo 'Problem Connection <br/>';}
if (mysqli_connect_errno())
{
echo "Failed to connect to MySQL: " . mysqli_connect_error();
}
}
public function conQuery($conQuery){
return $this->con->query($conQuery);
}
}
$c = new con();
$r = "INSERT INTO `send`(`id`, `packets`, `phone`, `typ`, `send`, `dat`) VALUES (null,'111111111','22222222','text',0,'1/1/1')";
$e = $c->conQuery($r);
if ($e) {
echo 'ok';
} else {
echo 'no';
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment