Skip to content

Instantly share code, notes, and snippets.

@sakshiagg1993
Created March 30, 2016 07:26
Show Gist options
  • Save sakshiagg1993/11749c8feadb01b28be9f48625b17b2f to your computer and use it in GitHub Desktop.
Save sakshiagg1993/11749c8feadb01b28be9f48625b17b2f to your computer and use it in GitHub Desktop.
<?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