Created
July 19, 2015 13:49
-
-
Save elmelegy/1c7521be85148f54c510 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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