Welcome, Guest: Register On Nairaland / LOGIN! / Trending / Recent / New
Stats: 3,162,129 members, 7,849,538 topics. Date: Monday, 03 June 2024 at 11:37 PM

Help Me Solve This AJAX Problem. - Programming - Nairaland

Nairaland Forum / Science/Technology / Programming / Help Me Solve This AJAX Problem. (1243 Views)

Please Help Me Solve This MATLAB Problems / Please Help Me Solve This Error Message On My Wordpress Site / Help Me Solve This Java Regex Problem (2) (3) (4)

(1) (Reply) (Go Down)

Help Me Solve This AJAX Problem. by Cheddareto(m): 5:53pm On Jan 01, 2017
Can someone tell me how I can send data to MySQL database from a Div in a page without refreshing the page...using Ajax pls
Re: Help Me Solve This AJAX Problem. by y0rmee: 6:05pm On Jan 01, 2017
Try studying how Ajax work. Visit w3schools.com or tutorialpoint

3 Likes

Re: Help Me Solve This AJAX Problem. by forap(m): 10:16pm On Jan 01, 2017
Make an ajax POST call to an endpoint, sending along the data you want to save to your mysql db, no?
Re: Help Me Solve This AJAX Problem. by daPretender: 9:53am On Jan 02, 2017
create an event listener for the action you want to perform
eg

<button name="button" onclick="ajaxPost()">Post</button>

//create an ajax POST, using jquery
function ajaxPost(){
var post_value1; // assign it to whatever you need to
var post_value2; // assign it to whatever you need to

//create a separate "actual_database_sending_page.php" script in the same directory that will accept post parameters post_name1, post_name2
$.post("actual_database_sending_page.php",
{
post_name1: post_value1,
post_name2: post_value2,
}, function(data, status){
// do whatever you want to do after running your php script, note 'data' is the output of "actual_database_sending_page.php"

});
}

1 Like

Re: Help Me Solve This AJAX Problem. by trytillmake(m): 11:47am On Jan 04, 2017

(1) (Reply)

Statistician With Good Knowledge Of R Programming, Spss, Excel, And Sas Needed! / I Need A Programmer For A Job / Urgent Job Opening For Software Developers And Software Architects

(Go Up)

Sections: politics (1) business autos (1) jobs (1) career education (1) romance computers phones travel sports fashion health
religion celebs tv-movies music-radio literature webmasters programming techmarket

Links: (1) (2) (3) (4) (5) (6) (7) (8) (9) (10)

Nairaland - Copyright © 2005 - 2024 Oluwaseun Osewa. All rights reserved. See How To Advertise. 10
Disclaimer: Every Nairaland member is solely responsible for anything that he/she posts or uploads on Nairaland.