0

I have a js function, in the function body I want to send data to the MySQL database.

I have a video ID and a user ID, and I want to send the video ID (which I already have stored in a var) and the user ID (which I don't have but it's for a different topic.)

This is what I need basically:

When something happens//{
Send videoID to database to some table
Send userID to database to some table
}

If you guys can help me clear things up a little bit, help me understand how am I supposed to do that, I would be grateful. Thanks! =)

  • 2
    you can use ajax (https://developer.mozilla.org/en-US/docs/Web/Guide/AJAX/Getting_Started) to send data to your server and that in turn can update your db – Philipp M Mar 07 '21 at 19:03
  • 1
    Like here: https://stackoverflow.com/questions/16834138/javascript-function-post-and-call-php-script/16834317 – Michel Drenth Mar 07 '21 at 19:39

0 Answers0