forked from kalyanm72/Online-Bus-Booking
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathread_user.php
More file actions
33 lines (31 loc) · 875 Bytes
/
Copy pathread_user.php
File metadata and controls
33 lines (31 loc) · 875 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
<?php
header('Access-Control-Allow-Origin: *' );
header('Content-Type:application/json' );
include_once 'Database.php';
include_once 'Post_user.php';
$database=new Database();
$db=$database->connect();
$users=new Post_user($db);
$result=$users->read();
$num=$result->rowCount();
if($num>0){
$users_array=array();
$users_array['data']=array();
while($row=$result->fetch(PDO::FETCH_ASSOC)){
extract($row);
$user_item=array(
'username'=> $username,
'password' =>$password,
'email'=> $email,
'mob' =>$mob,
'has_key' =>$has_key,
'verified'=> $verified,
'CreatedOn' =>$CreatedOn,
);
array_push($users_array['data'],$user_item);
}
echo json_encode($users_array);
}
else{
echo json_encode(array('message'=>'No routes found'));
}