<?php

/*Student API*/


/*Fetching API*/


/* Attempt to connect to MySQL database */
define('DB_SERVER', 'localhost');
define('DB_USERNAME', 'restax');

define('DB_PASSWORD', 'restax@123');

define('DB_NAME', 'Restax'); 

$con = new mysqli(DB_SERVER, DB_USERNAME, DB_PASSWORD, DB_NAME);

$course_id = $request->getAttribute('course_id');


// Check connection
if (mysqli_connect_errno())
  {
  echo "Failed to connect to MySQL: " . mysqli_connect_error();
  }

$response=array();

$sql="SELECT * FROM set_student_season WHERE id='12'";

$result=mysqli_query($con,$sql);

    while ($row=mysqli_fetch_assoc($result)) {  

  $example = array($row['papers_undertaking']);
  $papers=array_slice($example,0,6);
// Loop through colors array
foreach($example as $value){
    echo $value . "<br>";
}
// foreach($arr as $x=>$x_value)
//    {
//    echo "Key=" . $x . ", Value=" . $x_value;
//    echo "<br>";
//    }
 }
    



// 	$sql="SELECT student_name,rollnumber FROM set_student_season WHERE  course_id='$course_id'";

// $result=mysqli_query($con,$sql);

//     while ($row[]=mysqli_fetch_assoc($result)) {  

//       $user=$row;


//     }

// echo json_encode($user);

?>