[Vuejs]-Axios does not insert value into table

0👍

Try using PHP std object structure to get the variables of the post.

$connect = mysqli_connect('127.0.0.1', 'root', '', 'axios');
$_POST = json_decode(file_get_contents("php://input"),true);
echo $_POST['note_text'];
$sql = "INSERT INTO todo (name) VALUES ('" . $_POST['note_text'] ."')";
$query = mysqli_query($connect, $sql);

Leave a comment