Last active
August 29, 2015 14:25
-
-
Save elmelegy/df517553e253eb6fbde5 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(){ | |
$con = mysqli_connect('localhost', 'root', '', 'whatsapp'); | |
if($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 mysqli_query($this->con,$conQuery); | |
} | |
} | |
$c = new con(); | |
$r = "INSERT INTO `send`(`id`, `packets`, `phone`, `typ`, `send`, `dat`) VALUES (null,'111111111','22222222','text',0,'1/1/1')"; | |
$e = mysqli_query($c->con,$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
change the construct like this :
when use the class do: