Doing a post method on jQueryIs there an “exists” function for jQuery?Add table row in jQueryHow do I check if an element is hidden in jQuery?Setting “checked” for a checkbox with jQuery?How can I know which radio button is selected via jQuery?How to check whether a checkbox is checked in jQuery?Disable/enable an input with jQuery?How can I refresh a page with jQuery?jQuery scroll to element“Thinking in AngularJS” if I have a jQuery background?

What is the highest possible permanent AC at character creation?

Is using haveibeenpwned to validate password strength rational?

Pre-1972 sci-fi short story or novel: alien(?) tunnel where people try new moves and get destroyed if they're not the correct ones

System.StringException: Unexpected end of expression

How is water heavier than petrol, even though its molecular weight is less than petrol?

What ways have you found to get edits from non-LaTeX users?

Winning Strategy for the Magician and his Apprentice

Share calendar details request from manager's manager

What is the `some` keyword in SwiftUI?

Generate a Graeco-Latin square

bash script: "*.jpg" expansion not working as expected inside $(...), for picking a random file

Confusion around using "des" in sentences

English word for "product of tinkering"

What can I, as a user, do about offensive reviews in App Store?

How do governments keep track of their issued currency?

1980s live-action movie where individually-coloured nations on clouds fight

Were Alexander the Great and Hephaestion lovers?

Déjà vu, again?

Do simulator games use a realistic trajectory to get into orbit?

How does an ordinary object become radioactive?

Thread Pool C++ Implementation

Soft question: Examples where lack of mathematical rigour cause security breaches?

Why would future John risk sending back a T-800 to save his younger self?

How can electric fields be used to detect cracks in metals?



Doing a post method on jQuery


Is there an “exists” function for jQuery?Add table row in jQueryHow do I check if an element is hidden in jQuery?Setting “checked” for a checkbox with jQuery?How can I know which radio button is selected via jQuery?How to check whether a checkbox is checked in jQuery?Disable/enable an input with jQuery?How can I refresh a page with jQuery?jQuery scroll to element“Thinking in AngularJS” if I have a jQuery background?






.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty height:90px;width:728px;box-sizing:border-box;








0















enter image description here



I have a screenshot above I am trying to do a post method for adding another movie here is my code below



$(function()
$("#showMovies").click(function()
const $movielist = $('#movielist');
$.ajax(
method:"GET",
url: "http://localhost:3000/movielist",
dataType: "json",
success: function (response)
$.each(response, function(i, movie)
$movielist.append('<li>idmovielist: ' + movie.idmovielist + ', thumnail_path: ' +
movie.thumnail_path + ', description: ' + movie.description + ', year_released: ' + movie.year_released +
', language_released: ' + movie.language_released + '</li>');
);

);
);
$("#movieAdded").click(function()
const $idmovielist = $('#idmovielist');
const $name = $('#name');
const $thumnail_path = $('#thumnail_path');
const $description = $('description');
const $language_released = $('language_released');
const $year_released = $('year_released');
const movies =
idmovielist: $idmovielist.val(),
name: $name.val(),
thumnail_path: $thumnail_path.val(),
description: $description.val(),
year_released: $year_released.val(),
language_released: $language_released.val(),
;
$.ajax(
method:"POST",
url: "http://localhost:3000/movielist/addMovie",
data: movies,
success: function (newMovie)
$movielist.append('<li>idmovielist: ' + newMovie.idmovielist + ', thumnail_path: ' +
newMovie.thumnail_path + ', description: ' + newMovie.description + ', year_released: ' + newMovie.year_released +
', language_released: ' + newMovie.language_released + '</li>');

);
);
);


I am trying to post it but I can an error on my terminal that I have code:




'ER_PARSE_ERROR',

errno: 1064,

sqlMessage: 'You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 1',

sqlState: '42000',

index: 0,

sql: 'INSERT INTO movielist SET ' }











share|improve this question
























  • Post the error as well

    – Pranav C Balan
    Mar 24 at 17:21






  • 1





    The the problem is inside addMovie method on the server side. Show us your method implementation.

    – Allen King
    Mar 24 at 17:30












  • @AllenKing app.post('/movielist/addMovie',(req, res) => mysqlConnection.query("INSERT INTO movielist SET ?",req.body, (err,rows) => if (!err) res.send("Movie is added"); else console.log(err); ); ); this is what I got

    – Adil Ali
    Mar 24 at 17:32











  • The request body is a json object.

    – Allen King
    Mar 24 at 17:41












  • @AllenKing I know and

    – Adil Ali
    Mar 24 at 17:43

















0















enter image description here



I have a screenshot above I am trying to do a post method for adding another movie here is my code below



$(function()
$("#showMovies").click(function()
const $movielist = $('#movielist');
$.ajax(
method:"GET",
url: "http://localhost:3000/movielist",
dataType: "json",
success: function (response)
$.each(response, function(i, movie)
$movielist.append('<li>idmovielist: ' + movie.idmovielist + ', thumnail_path: ' +
movie.thumnail_path + ', description: ' + movie.description + ', year_released: ' + movie.year_released +
', language_released: ' + movie.language_released + '</li>');
);

);
);
$("#movieAdded").click(function()
const $idmovielist = $('#idmovielist');
const $name = $('#name');
const $thumnail_path = $('#thumnail_path');
const $description = $('description');
const $language_released = $('language_released');
const $year_released = $('year_released');
const movies =
idmovielist: $idmovielist.val(),
name: $name.val(),
thumnail_path: $thumnail_path.val(),
description: $description.val(),
year_released: $year_released.val(),
language_released: $language_released.val(),
;
$.ajax(
method:"POST",
url: "http://localhost:3000/movielist/addMovie",
data: movies,
success: function (newMovie)
$movielist.append('<li>idmovielist: ' + newMovie.idmovielist + ', thumnail_path: ' +
newMovie.thumnail_path + ', description: ' + newMovie.description + ', year_released: ' + newMovie.year_released +
', language_released: ' + newMovie.language_released + '</li>');

);
);
);


I am trying to post it but I can an error on my terminal that I have code:




'ER_PARSE_ERROR',

errno: 1064,

sqlMessage: 'You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 1',

sqlState: '42000',

index: 0,

sql: 'INSERT INTO movielist SET ' }











share|improve this question
























  • Post the error as well

    – Pranav C Balan
    Mar 24 at 17:21






  • 1





    The the problem is inside addMovie method on the server side. Show us your method implementation.

    – Allen King
    Mar 24 at 17:30












  • @AllenKing app.post('/movielist/addMovie',(req, res) => mysqlConnection.query("INSERT INTO movielist SET ?",req.body, (err,rows) => if (!err) res.send("Movie is added"); else console.log(err); ); ); this is what I got

    – Adil Ali
    Mar 24 at 17:32











  • The request body is a json object.

    – Allen King
    Mar 24 at 17:41












  • @AllenKing I know and

    – Adil Ali
    Mar 24 at 17:43













0












0








0








enter image description here



I have a screenshot above I am trying to do a post method for adding another movie here is my code below



$(function()
$("#showMovies").click(function()
const $movielist = $('#movielist');
$.ajax(
method:"GET",
url: "http://localhost:3000/movielist",
dataType: "json",
success: function (response)
$.each(response, function(i, movie)
$movielist.append('<li>idmovielist: ' + movie.idmovielist + ', thumnail_path: ' +
movie.thumnail_path + ', description: ' + movie.description + ', year_released: ' + movie.year_released +
', language_released: ' + movie.language_released + '</li>');
);

);
);
$("#movieAdded").click(function()
const $idmovielist = $('#idmovielist');
const $name = $('#name');
const $thumnail_path = $('#thumnail_path');
const $description = $('description');
const $language_released = $('language_released');
const $year_released = $('year_released');
const movies =
idmovielist: $idmovielist.val(),
name: $name.val(),
thumnail_path: $thumnail_path.val(),
description: $description.val(),
year_released: $year_released.val(),
language_released: $language_released.val(),
;
$.ajax(
method:"POST",
url: "http://localhost:3000/movielist/addMovie",
data: movies,
success: function (newMovie)
$movielist.append('<li>idmovielist: ' + newMovie.idmovielist + ', thumnail_path: ' +
newMovie.thumnail_path + ', description: ' + newMovie.description + ', year_released: ' + newMovie.year_released +
', language_released: ' + newMovie.language_released + '</li>');

);
);
);


I am trying to post it but I can an error on my terminal that I have code:




'ER_PARSE_ERROR',

errno: 1064,

sqlMessage: 'You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 1',

sqlState: '42000',

index: 0,

sql: 'INSERT INTO movielist SET ' }











share|improve this question
















enter image description here



I have a screenshot above I am trying to do a post method for adding another movie here is my code below



$(function()
$("#showMovies").click(function()
const $movielist = $('#movielist');
$.ajax(
method:"GET",
url: "http://localhost:3000/movielist",
dataType: "json",
success: function (response)
$.each(response, function(i, movie)
$movielist.append('<li>idmovielist: ' + movie.idmovielist + ', thumnail_path: ' +
movie.thumnail_path + ', description: ' + movie.description + ', year_released: ' + movie.year_released +
', language_released: ' + movie.language_released + '</li>');
);

);
);
$("#movieAdded").click(function()
const $idmovielist = $('#idmovielist');
const $name = $('#name');
const $thumnail_path = $('#thumnail_path');
const $description = $('description');
const $language_released = $('language_released');
const $year_released = $('year_released');
const movies =
idmovielist: $idmovielist.val(),
name: $name.val(),
thumnail_path: $thumnail_path.val(),
description: $description.val(),
year_released: $year_released.val(),
language_released: $language_released.val(),
;
$.ajax(
method:"POST",
url: "http://localhost:3000/movielist/addMovie",
data: movies,
success: function (newMovie)
$movielist.append('<li>idmovielist: ' + newMovie.idmovielist + ', thumnail_path: ' +
newMovie.thumnail_path + ', description: ' + newMovie.description + ', year_released: ' + newMovie.year_released +
', language_released: ' + newMovie.language_released + '</li>');

);
);
);


I am trying to post it but I can an error on my terminal that I have code:




'ER_PARSE_ERROR',

errno: 1064,

sqlMessage: 'You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 1',

sqlState: '42000',

index: 0,

sql: 'INSERT INTO movielist SET ' }








jquery






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Mar 24 at 21:19









marc_s

592k13311331278




592k13311331278










asked Mar 24 at 17:19









Adil AliAdil Ali

44




44












  • Post the error as well

    – Pranav C Balan
    Mar 24 at 17:21






  • 1





    The the problem is inside addMovie method on the server side. Show us your method implementation.

    – Allen King
    Mar 24 at 17:30












  • @AllenKing app.post('/movielist/addMovie',(req, res) => mysqlConnection.query("INSERT INTO movielist SET ?",req.body, (err,rows) => if (!err) res.send("Movie is added"); else console.log(err); ); ); this is what I got

    – Adil Ali
    Mar 24 at 17:32











  • The request body is a json object.

    – Allen King
    Mar 24 at 17:41












  • @AllenKing I know and

    – Adil Ali
    Mar 24 at 17:43

















  • Post the error as well

    – Pranav C Balan
    Mar 24 at 17:21






  • 1





    The the problem is inside addMovie method on the server side. Show us your method implementation.

    – Allen King
    Mar 24 at 17:30












  • @AllenKing app.post('/movielist/addMovie',(req, res) => mysqlConnection.query("INSERT INTO movielist SET ?",req.body, (err,rows) => if (!err) res.send("Movie is added"); else console.log(err); ); ); this is what I got

    – Adil Ali
    Mar 24 at 17:32











  • The request body is a json object.

    – Allen King
    Mar 24 at 17:41












  • @AllenKing I know and

    – Adil Ali
    Mar 24 at 17:43
















Post the error as well

– Pranav C Balan
Mar 24 at 17:21





Post the error as well

– Pranav C Balan
Mar 24 at 17:21




1




1





The the problem is inside addMovie method on the server side. Show us your method implementation.

– Allen King
Mar 24 at 17:30






The the problem is inside addMovie method on the server side. Show us your method implementation.

– Allen King
Mar 24 at 17:30














@AllenKing app.post('/movielist/addMovie',(req, res) => mysqlConnection.query("INSERT INTO movielist SET ?",req.body, (err,rows) => if (!err) res.send("Movie is added"); else console.log(err); ); ); this is what I got

– Adil Ali
Mar 24 at 17:32





@AllenKing app.post('/movielist/addMovie',(req, res) => mysqlConnection.query("INSERT INTO movielist SET ?",req.body, (err,rows) => if (!err) res.send("Movie is added"); else console.log(err); ); ); this is what I got

– Adil Ali
Mar 24 at 17:32













The request body is a json object.

– Allen King
Mar 24 at 17:41






The request body is a json object.

– Allen King
Mar 24 at 17:41














@AllenKing I know and

– Adil Ali
Mar 24 at 17:43





@AllenKing I know and

– Adil Ali
Mar 24 at 17:43












0






active

oldest

votes












Your Answer






StackExchange.ifUsing("editor", function ()
StackExchange.using("externalEditor", function ()
StackExchange.using("snippets", function ()
StackExchange.snippets.init();
);
);
, "code-snippets");

StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "1"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);

StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);

else
createEditor();

);

function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader:
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
,
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);



);













draft saved

draft discarded


















StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55326426%2fdoing-a-post-method-on-jquery%23new-answer', 'question_page');

);

Post as a guest















Required, but never shown

























0






active

oldest

votes








0






active

oldest

votes









active

oldest

votes






active

oldest

votes















draft saved

draft discarded
















































Thanks for contributing an answer to Stack Overflow!


  • Please be sure to answer the question. Provide details and share your research!

But avoid …


  • Asking for help, clarification, or responding to other answers.

  • Making statements based on opinion; back them up with references or personal experience.

To learn more, see our tips on writing great answers.




draft saved


draft discarded














StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55326426%2fdoing-a-post-method-on-jquery%23new-answer', 'question_page');

);

Post as a guest















Required, but never shown





















































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown

































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown







Popular posts from this blog

How to preserve electronics (computers, tablets and phones) for hundreds of years Announcing the arrival of Valued Associate #679: Cesar Manara Planned maintenance scheduled April 23, 2019 at 23:30 UTC (7:30pm US/Eastern) The network's official Twitter account is up and running again. What content…How might modern humans leave a message for 50,000 years?How would an aquatic race develop computers?How do we make computers care for human life?Keeping supplies for 1000 yearsWhat will cell phones become in 100 years?What body armor protects against a laser?Could a society attain 1800s technology if limited to using copper and bronze?Electricity power (magic) and electronicsScavenging metal resources in post-apocalypse after 100 yearsWhy would precursors create devices that can survive and still work after hundreds of years?

155 수학 과학 기타 둘러보기 메뉴eh추가해eh문서를 완성해

Convert JSON to MapSimplest way to convert a string representing JSON array into Java array List of key value pairsHow to take String JSON values into HashMapConvert a JSON String to a HashMapCreating BSON object from JSON stringJSONObject - How to get a value ?Better Map ConstructorReading JSON from Url javaUpdate columns if input values are not null otherwise ignore and keep the existing values of column in databaseHow to store object represented as Json string into Couchbase Lite?Go JSON into MapHow do I efficiently iterate over each entry in a Java Map?Sort a Map<Key, Value> by valuesHow to round a number to n decimal places in JavaCan comments be used in JSON?How do I read / convert an InputStream into a String in Java?How can I pretty-print JSON in a shell script?What is the correct JSON content type?How can I deserialize JSON to a simple Dictionary<string,string> in ASP.NET?Why does Google prepend while(1); to their JSON responses?Parse JSON in JavaScript?