Created
March 30, 2016 07:26
-
-
Save sakshiagg1993/11749c8feadb01b28be9f48625b17b2f 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 | |
define('HOST','http://cpanel.byethost.com'); | |
define('USER','b14_17753534'); | |
define('PASS','Skshiagg1234'); | |
define('DB','b14_17753534_userinfo'); | |
$con = mysqli_connect(HOST,USER,PASS,DB); | |
$sql = "select * from userinfo"; | |
$res = mysqli_query($con,$sql); | |
$result = array(); | |
while($row = mysqli_fetch_array($res)){ | |
array_push($result, | |
array('emailid'=>$row[0], | |
'phonenumber'=>$row[1], | |
)); | |
} | |
echo json_encode(array("result"=>$result)); | |
mysqli_close($con); | |
?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment