/rawridehistory.php
https://bitbucket.org/electricsheep/wheelsharephp · PHP · 67 lines · 27 code · 9 blank · 31 comment · 0 complexity · 9625cb54020e4380438509a43008cf74 MD5 · raw file
- <?php
- mysql_connect("localhost", "electricsheep", "android") or die(mysql_error());
- mysql_select_db("wheelshare") or die(mysql_error());
- $uid = $_GET['id'];
- /*Order of data items in Ride.java
- private String id;
- private String owner;
- private String numberSeats;
- private String full;
- private String fromLocation;
- private String toDestination;
- private String rideDate;
- private String recurring;
- private String fromDate;
- private String toDate;
- private String frequency;
- private String costPerMile;
- private String startTime;
- */
- $sql2 = "select * from ridedata as r left outer join passengerdata as p on r.id = p.rideid where r.complete = 'Yes' and (r.ownerid = '$uid' or p.userid = '$uid')";
- /*
- $result1 = mysql_query($sql);
- while($row = mysql_fetch_array($result1)){
- $rideDate = $row['rideDate'];
- $fromLocation = $row['fromLocation'];
- $toDestination = $row['toDestination'];
- $requester = $row['requester'];
- $recurring = $row['recurring'];
- $frequency = $row['frequency'];
- $fromDate = $row['fromDate'];
- $toDate = $row['toDate'];
- }
- */
- //$sql2 = "select * from ridedata where fromlocation like '$fromLocation' and todestination like '$toDestination' and full <> "Yes" and fromdate='$fromdate'";
- //$sql2 = "select * from ridedata where fromlocation like '$fromLocation'";
- $result2 = mysql_query($sql2);
- while($row2 = mysql_fetch_array($result2)){
- $res_rideId = $row2['id'];
- $res_fromDate = $row2['fromdate'];
- $res_fromLocation = $row2['fromlocation'];
- $res_toDestination = $row2['todestination'];
- $res_owner = $row2['owner'];
- $res_ownerId = $row2['ownerid'];
- $res_time = $row2['starttime'];
- $res_cost = $row2['costpermile'];
- $res_seats = $row2['numberseats'];
- $res_toDate = $row2['todate'];
- $res_recurring = $row2['recurring'];
- $res_rideDate = $row2['fromdate'];
- $res_full = $row2['full'];
- $res_frequency = $row2['frequency'];
- echo $res_rideId . "," . $res_owner . "," . $res_seats . "," .
- $res_full . "," . $res_fromLocation . "," . $res_toDestination . "," .
- $res_rideDate . "," . $res_recurring . "," . $res_fromDate . "," .
- $res_toDate . "," . $res_frequency . "," . $res_cost . "," . $res_time . ";";
- }
- ?>