Last active
September 23, 2015 14:46
-
-
Save vinay13/93ebcb48f9b9078fa3ea to your computer and use it in GitHub Desktop.
This file contains hidden or 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 | |
| /* include db.config.php */ | |
| include_once(‘includes/config.php’); | |
| //@required_once(); | |
| // Get user id | |
| $id = isset($_GET['id']) ? mysql_real_escape_string($_GET['id']) : “”; | |
| if(empty($id)){ | |
| $reponse['user']=array(); | |
| } | |
| else { | |
| // get user data | |
| $sql = “SELECT * FROM post where userid=’$user_id’”; | |
| $select = mysql_query($sql); | |
| $repo = array(); | |
| while($row = mysql_fetch_array($rows)) { | |
| $user = array(); | |
| $user['userid']=$row['user_id']; | |
| $user['username']=$row['name']; | |
| $user['emailID']=$row['emailID']; | |
| $user['total_post']=$row['total_post'] | |
| array_push($respo,$user) | |
| } | |
| $response['user']=$respo; | |
| } | |
| echo json_encode($response); | |
| mysql_close($conn); | |
| /* JSON Response */ | |
| header(‘Content-type: application/json’); | |
| echo json_encode($data); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment