Linux ip-172-26-7-228 5.4.0-1103-aws #111~18.04.1-Ubuntu SMP Tue May 23 20:04:10 UTC 2023 x86_64
Your IP : 18.188.62.10
<?php
include("/var/www/config.php");
$servername = SERVERNAME;
$username = USERNAME;
$password = PASSWORD;
$db = "logisys3_comexam";
$conn = new mysqli($servername,$username,$password,$db);
if(!$conn)
{
die("Connection failed: " . mysqli_connect_error());
}
$query = "select University_SSP_Code as University_Code,
University_Name as University_name,
University_Registration_Number as Registration_Number,
Academic_Year_code as Academic_Year,
STUDENT_NAME as Student_Name,
Course_Year
from govt_scholorship_data";
$result = mysqli_query($conn, $query);
$data;
$i =0;
while ($row = mysqli_fetch_row($result)) {
var_dump($row);
die();
// $data[$i]->University_Code = $row['University_Code'];
// $data[$i]->University_name = $row['University_name'];
// $data[$i]->Registration_Number = $row['Registration_Number'];
// $data[$i]->Academic_Year = $row['Academic_Year'];
// $data[$i]->Student_Name = $row['Student_Name'];
// $data[$i]->Course_Year = $row['Course_Year'];
$i++;
}
var_dump($data);
die();
$fields = array
(
'data' => $data
);
var_dump($fields);
die();
$headers = array
(
'Authorization:1234567890',
'Content-Type: application/json'
);
//var_dump($headers);
$ch = curl_init();
curl_setopt( $ch,CURLOPT_URL, 'https://ssp.postmatric.karnataka.gov.in/UniAPI/api/university_data/' );
curl_setopt( $ch,CURLOPT_POST, true );
curl_setopt( $ch,CURLOPT_HTTPHEADER, $headers );
curl_setopt( $ch,CURLOPT_RETURNTRANSFER, true );
curl_setopt( $ch,CURLOPT_SSL_VERIFYPEER, false );
curl_setopt( $ch,CURLOPT_POSTFIELDS, json_encode( $fields ) );
$result = curl_exec($ch);
curl_close( $ch );
echo $result;
|