I am getting an Error: ER_SP_UNDECLARED_VAR: Undeclared variable: NaN when trying AJAX request with jQueryNode.js MySQL module - throw err; // Rethrow non-MySQL errors;How can I get jQuery to perform a synchronous, rather than asynchronous, Ajax request?How to manage a redirect request after a jQuery Ajax calljQuery Ajax error handling, show custom exception messagesAbort Ajax requests using jQueryWait until all jQuery Ajax requests are done?Ajax request returns 200 OK, but an error event is fired instead of successHow to send FormData objects with Ajax-requests in jQuery?Add Header in AJAX Request with jQueryWhy does my JavaScript get a “No 'Access-Control-Allow-Origin' header is present on the requested resource” error when Postman does not?getting callback error even though “I think” I set it up as a function

Yosemite Fire Rings - What to Expect?

If infinitesimal transformations commute why dont the generators of the Lorentz group commute?

How do you make your own symbol when Detexify fails?

What is this called? Old film camera viewer?

How can Trident be so inexpensive? Will it orbit Triton or just do a (slow) flyby?

Sklearn 'Seed' Not Working Properly In a Section of Code

How does a computer interpret real numbers?

Why a symmetric relation is defined: ∀x∀y( xRy⟹yRx) and not ∀x∀y (xRy⟺yRx)?

On a tidally locked planet, would time be quantized?

The probability of Bus A arriving before Bus B

How can I block email signup overlays or javascript popups in Safari?

Is it better practice to read straight from sheet music rather than memorize it?

Fear of getting stuck on one programming language / technology that is not used in my country

Dealing with a rejection from a journal

Why does the Sun have different day lengths, but not the gas giants?

Basic combinatorial probability problem

What changes for testers when they are testing in agile environments?

Redundant comparison & "if" before assignment

Python scanner for the first free port in a range

Did arcade monitors have same pixel aspect ratio as TV sets?

Does a 'pending' US visa application constitute a denial?

Explaining alternative travel routes when going to the USA

How can "mimic phobia" be cured or prevented?

New brakes for 90s road bike



I am getting an Error: ER_SP_UNDECLARED_VAR: Undeclared variable: NaN when trying AJAX request with jQuery


Node.js MySQL module - throw err; // Rethrow non-MySQL errors;How can I get jQuery to perform a synchronous, rather than asynchronous, Ajax request?How to manage a redirect request after a jQuery Ajax calljQuery Ajax error handling, show custom exception messagesAbort Ajax requests using jQueryWait until all jQuery Ajax requests are done?Ajax request returns 200 OK, but an error event is fired instead of successHow to send FormData objects with Ajax-requests in jQuery?Add Header in AJAX Request with jQueryWhy does my JavaScript get a “No 'Access-Control-Allow-Origin' header is present on the requested resource” error when Postman does not?getting callback error even though “I think” I set it up as a function













0















I am getting this error
` throw err; // Rethrow non-MySQL errors
^



Error: ER_SP_UNDECLARED_VAR: Undeclared variable: NaN
`
when trying to do jQuery AJAX get request, and i don't know why.
I'm using node.js and MySQL for backend part, and jQuery for frontend part.
This is node.js:



Users.prototype.get_limited_data = function(page_number, callback) 
let blocksize = 12;
let offset = (page_number - 1) * blocksize;
var query = "select * from test_video_category limit ? offset ?";
this.conn.query(query, [blocksize, offset], function(err,rows)
if(err) throw err;
callback(err,rows);
)
;

router.get('/new-preview-page-data', function (req, res, next)
req.getConnection(function (err, connection)
if (err) return next(err);
let page_number = req.query.page_number;
let Users = new users(connection);
Users.get_limited_data ( page_number,function (err, rows)
if (err) throw err;
res.render('marketplace', preview_data : rows);
);
);
);


And this is jquery:



 $.ajax(
type: "GET",
url: "new-preview-page-data",
success: function (data, status)
console.log(data);
,
error: function ()
console.log("error");

);


And jade is used for templating.
This is the error



/home/nikola/Desktop/reevio/template_app/node_modules/mysql/lib/protocol/Parser.js:80
throw err; // Rethrow non-MySQL errors
^


Error: ER_SP_UNDECLARED_VAR: Undeclared variable: NaN










share|improve this question
























  • Please post the full stack trace.

    – samb102
    2 days ago















0















I am getting this error
` throw err; // Rethrow non-MySQL errors
^



Error: ER_SP_UNDECLARED_VAR: Undeclared variable: NaN
`
when trying to do jQuery AJAX get request, and i don't know why.
I'm using node.js and MySQL for backend part, and jQuery for frontend part.
This is node.js:



Users.prototype.get_limited_data = function(page_number, callback) 
let blocksize = 12;
let offset = (page_number - 1) * blocksize;
var query = "select * from test_video_category limit ? offset ?";
this.conn.query(query, [blocksize, offset], function(err,rows)
if(err) throw err;
callback(err,rows);
)
;

router.get('/new-preview-page-data', function (req, res, next)
req.getConnection(function (err, connection)
if (err) return next(err);
let page_number = req.query.page_number;
let Users = new users(connection);
Users.get_limited_data ( page_number,function (err, rows)
if (err) throw err;
res.render('marketplace', preview_data : rows);
);
);
);


And this is jquery:



 $.ajax(
type: "GET",
url: "new-preview-page-data",
success: function (data, status)
console.log(data);
,
error: function ()
console.log("error");

);


And jade is used for templating.
This is the error



/home/nikola/Desktop/reevio/template_app/node_modules/mysql/lib/protocol/Parser.js:80
throw err; // Rethrow non-MySQL errors
^


Error: ER_SP_UNDECLARED_VAR: Undeclared variable: NaN










share|improve this question
























  • Please post the full stack trace.

    – samb102
    2 days ago













0












0








0








I am getting this error
` throw err; // Rethrow non-MySQL errors
^



Error: ER_SP_UNDECLARED_VAR: Undeclared variable: NaN
`
when trying to do jQuery AJAX get request, and i don't know why.
I'm using node.js and MySQL for backend part, and jQuery for frontend part.
This is node.js:



Users.prototype.get_limited_data = function(page_number, callback) 
let blocksize = 12;
let offset = (page_number - 1) * blocksize;
var query = "select * from test_video_category limit ? offset ?";
this.conn.query(query, [blocksize, offset], function(err,rows)
if(err) throw err;
callback(err,rows);
)
;

router.get('/new-preview-page-data', function (req, res, next)
req.getConnection(function (err, connection)
if (err) return next(err);
let page_number = req.query.page_number;
let Users = new users(connection);
Users.get_limited_data ( page_number,function (err, rows)
if (err) throw err;
res.render('marketplace', preview_data : rows);
);
);
);


And this is jquery:



 $.ajax(
type: "GET",
url: "new-preview-page-data",
success: function (data, status)
console.log(data);
,
error: function ()
console.log("error");

);


And jade is used for templating.
This is the error



/home/nikola/Desktop/reevio/template_app/node_modules/mysql/lib/protocol/Parser.js:80
throw err; // Rethrow non-MySQL errors
^


Error: ER_SP_UNDECLARED_VAR: Undeclared variable: NaN










share|improve this question
















I am getting this error
` throw err; // Rethrow non-MySQL errors
^



Error: ER_SP_UNDECLARED_VAR: Undeclared variable: NaN
`
when trying to do jQuery AJAX get request, and i don't know why.
I'm using node.js and MySQL for backend part, and jQuery for frontend part.
This is node.js:



Users.prototype.get_limited_data = function(page_number, callback) 
let blocksize = 12;
let offset = (page_number - 1) * blocksize;
var query = "select * from test_video_category limit ? offset ?";
this.conn.query(query, [blocksize, offset], function(err,rows)
if(err) throw err;
callback(err,rows);
)
;

router.get('/new-preview-page-data', function (req, res, next)
req.getConnection(function (err, connection)
if (err) return next(err);
let page_number = req.query.page_number;
let Users = new users(connection);
Users.get_limited_data ( page_number,function (err, rows)
if (err) throw err;
res.render('marketplace', preview_data : rows);
);
);
);


And this is jquery:



 $.ajax(
type: "GET",
url: "new-preview-page-data",
success: function (data, status)
console.log(data);
,
error: function ()
console.log("error");

);


And jade is used for templating.
This is the error



/home/nikola/Desktop/reevio/template_app/node_modules/mysql/lib/protocol/Parser.js:80
throw err; // Rethrow non-MySQL errors
^


Error: ER_SP_UNDECLARED_VAR: Undeclared variable: NaN







javascript jquery mysql node.js






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited 2 days ago







Nikola Lucin

















asked 2 days ago









Nikola LucinNikola Lucin

32




32












  • Please post the full stack trace.

    – samb102
    2 days ago

















  • Please post the full stack trace.

    – samb102
    2 days ago
















Please post the full stack trace.

– samb102
2 days ago





Please post the full stack trace.

– samb102
2 days ago












1 Answer
1






active

oldest

votes


















0














As its not clear what basically the error is, i would recommend you to first catch the error properly and then it will be know what's the problem is. To catch the error you can use this. Let me know if this help you out.



con.on('error', function(err)
console.log("[mysql error]",err);
);



There is a question which is ask already over here.






share|improve this answer






















    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%2f55281266%2fi-am-getting-an-error-er-sp-undeclared-var-undeclared-variable-nan-when-tryin%23new-answer', 'question_page');

    );

    Post as a guest















    Required, but never shown

























    1 Answer
    1






    active

    oldest

    votes








    1 Answer
    1






    active

    oldest

    votes









    active

    oldest

    votes






    active

    oldest

    votes









    0














    As its not clear what basically the error is, i would recommend you to first catch the error properly and then it will be know what's the problem is. To catch the error you can use this. Let me know if this help you out.



    con.on('error', function(err)
    console.log("[mysql error]",err);
    );



    There is a question which is ask already over here.






    share|improve this answer



























      0














      As its not clear what basically the error is, i would recommend you to first catch the error properly and then it will be know what's the problem is. To catch the error you can use this. Let me know if this help you out.



      con.on('error', function(err)
      console.log("[mysql error]",err);
      );



      There is a question which is ask already over here.






      share|improve this answer

























        0












        0








        0







        As its not clear what basically the error is, i would recommend you to first catch the error properly and then it will be know what's the problem is. To catch the error you can use this. Let me know if this help you out.



        con.on('error', function(err)
        console.log("[mysql error]",err);
        );



        There is a question which is ask already over here.






        share|improve this answer













        As its not clear what basically the error is, i would recommend you to first catch the error properly and then it will be know what's the problem is. To catch the error you can use this. Let me know if this help you out.



        con.on('error', function(err)
        console.log("[mysql error]",err);
        );



        There is a question which is ask already over here.







        share|improve this answer












        share|improve this answer



        share|improve this answer










        answered 2 days ago









        Abdulhaq ShahAbdulhaq Shah

        17




        17





























            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%2f55281266%2fi-am-getting-an-error-er-sp-undeclared-var-undeclared-variable-nan-when-tryin%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

            Obelisk of Theodosius Contents History Description Notes Bibliography Further reading External links Navigation menuAge of spirituality : late antique and early Christian art, third to seventh centuryOver 60 picturesObelisks of the World41°00′21.24″N 28°58′31.43″E / 41.0059000°N 28.9753972°E / 41.0059000; 28.97539727724550-7235741376235741376

            밀양 대씨 역사 각주 함께 보기 둘러보기 메뉴밀양 대씨

            1973년 목차 사건 문화 탄생 사망 노벨상 달력 둘러보기 메뉴