Posts

Showing posts from December, 2017

allphp

1. job.php ------------------------------------------------------------------------------------------------- <?php $dbname = "2216189_db"; $user = "2216189_db"; $pass = "password1@"; $servername = "fdb14.awardspace.net"; // Create connection         $con =  mysqli_connect($servername,$user,$pass,$dbname); $filter_field = isset($_GET['filter']) ? $_GET['filter'] : 10; //10 is the default $sql = "SELECT * FROM job ORDER BY ".$filter_field; $sql = "SELECT * FROM job ORDER BY salary"; $result  = array(); $ro = $con->query($sql); if ($ro->num_rows > 0) { while($row = $ro->fetch_assoc()) { $date = new DateTime($row["last_date"]); $res_date = $date->format('Y-m-d H:i:s'); $res[] = array("job_id" => $row["job_id"],"job_name" => $row["job_name"],"place" => $ro

Using OKHttp3

// It is used to get JsonData from URL new AsyncTask<Void, Void,String>() { @Override protected String doInBackground(Void... voids) { OkHttpClient okHttp = new OkHttpClient(); Request request = new Request.Builder().url( "https://api.github.com/users/ashokslsk" ).build(); try { Response response = okHttp.newCall(request).execute(); System. out .println( "ResponseRupal:::::" + response.body().string()); return "Hi" ; } catch (IOException e) { e.printStackTrace(); } return null ; } }.execute();