Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is it possible to insert a new record in database table using jquery and mysql?

Tags:

jquery

mysql

i've attend the interview for a job, they asked me one question like how do you insert a new record to the DB using only jquery and mysql? I answered to use jquery ajax, but they don't accept, they said we want to use only jquery and mysql and not any other. I've searched in google and didn't get possible solutions. Can you help me?

like image 826
chella Avatar asked Dec 12 '22 19:12

chella


1 Answers

JavaScript/jQuery can not connect directly to the database And that is good for many reasons

You need to make an Ajax call to the server to send the data that you want to be placed into the database. Youe server side code in the backed would do the connection to the mysql server.

like image 90
GajendraSinghParihar Avatar answered May 01 '23 13:05

GajendraSinghParihar