Method to get Data: I am trying to get data with axios
. But there is no result is coming and also there is no error!!!!!
getTodoList() {
axios({
method: 'GET',
url: 'api/todos.php'
}).then(function(res){
console.log(res);
})
}
It is giving me this Result:
api.todos.php
<?php
class Todo {
private $connection_string ;
public function __construct() {
// connection code. Connection is okay.
}
public function fetchTodo() {
$sql = "SELECT * FROM todo ";
$result = mysqli_query($this->connection_string, $sql);
}
}
$todo = new Todo;
$todo->fetchTodo();
?>
What is the problem, I can't understand!!