I need to insert data as multiple rows using an array of the javascript object.
props.email is held an array such as
props.email = [
{email: '[email protected]', name: 'najathi'},
{email: '[email protected]', name: 'naharni'},
]
axios.post('/create-email.php', props.email, {
headers: { 'Content-Type': 'application/x-www-form-urlencoded' }
})
.then(response => {
console.log(response);
})
.catch(error => {
console.log(error);
});
JSON.stringify(), to convert your array of objects to a string, then send data to your backend.