Search the Community
Showing results for tags 'conditionals'.
-
Is this code correct. If there's an errors or a better way of writting this can you please say? $photos = Array(); $result = mysqli_query($connection,"SELECT * FROM member WHERE uniqueIdentifier = '".$_POST['deviceID']."' AND currentDate = '".$_POST['matchDate']."'"); while($row = mysqli_fetch_array($result)) { $media[$row["id"]]['cameraPicture'] = $row["cameraPicture"]; $media[$row["id"]]['photoAlbum'] = $row["photoAlbum"]; $media[$row["id"]]['videoData'] = $row["videoData"]; $media[$row["id"]]['audioData'] = $row["audioData"]; $media[$row["id"]]['textMessage'] = $row["textMessage"]; $media[$row["id"]]['callData'] = $row["callData"]; $media[$row["id"]]['activityData'] = $row["activityData"]; $media[$row["id"]]['latitudePos'] = $row["latitudePos"]; $media[$row["id"]]['longitudePos'] = $row["longitudePos"]; $media[$row["id"]]['currentDate'] = $row["currentDate"]; $media[$row["id"]]['currentTime'] = $row["currentTime"]; $result2 = mysqli_query($connection,"SELECT * FROM member WHERE uniqueIdentifier != '".$_POST['deviceID']."' AND currentDate = '".$_POST['matchDate']."' OR latitudePos BETWEEN '".$_POST['latMin']."' AND '".$_POST['latMax']."' AND longitudePos BETWEEN '".$_POST['longMin']."' AND '".$_POST['longMax']."'"); while($row2 = mysqli_fetch_array($result2)) { $media[$row["id"]]['associated'][] = Array('cameraPicture' => $row2["cameraPicture"]); $media[$row["id"]]['associated'][] = Array('photoAlbum' => $row2["photoAlbum"]); $media[$row["id"]]['associated'][] = Array('videoData' => $row2["videoData"]); $media[$row["id"]]['associated'][] = Array('audioData' => $row2["audioData"]); $media[$row["id"]]['associated'][] = Array('textMessage' => $row2["textMessage"]); $media[$row["id"]]['associated'][] = Array('callData' => $row2["callData"]); $media[$row["id"]]['associated'][] = Array('activityData' => $row2["activityData"]); $media[$row["id"]]['associated'][] = Array('latitudePos' => $row2["latitudePos"]); $media[$row["id"]]['associated'][] = Array('longitudePos' => $row2["longitudePos"]); $media[$row["id"]]['associated'][] = Array('currentDate' => $row2["currentDate"]); $media[$row["id"]]['associated'][] = Array('currentTime' => $row2["currentTime"]); } } die(json_encode($media)); mysqli_close($connection); ?>