Northern Flame Posted February 17, 2008 Share Posted February 17, 2008 Hello, I have been programming in PHP for awhile now and I now want to learn AJAX as well. I have never done anything with AJAX and thought of a good idea for my first project. I have a page that will have 3 important things, [search box] List Of Songs gotten from MySQL Database after user inserts search words! List of songs that user has pre-selected and are in mysql db I know how to have the items go from left to right on the click of a button from to select boxes via javascript, but what i want done is when the user clicks the button from left to right or from right to left, i want it to either insert or delete the song from the db, also, when the user types the search terms in the search form, i want the results shown in the left select box, i know how to do all this normally with php, meaning the the page will have to re-fresh everytime these actions are executed. but i want this done with ajax so the page doesnt have to be re-loaded. im not asking for anyone to code this for me what i want is for someone to explain to me the basics of these things, (how exactly do i do this, ive googled it but didnt have much luck): - run a mysql_query() with AJAX - show data with something like mysql_fetch_array() in AJAX - update an XML file with AJAX if someone can please show me how to do those three things i would greatly appreciate it! Quote Link to comment Share on other sites More sharing options...
priti Posted February 19, 2008 Share Posted February 19, 2008 Hi, '>' you have to insert in db '<' you have to delete in db when a user clicks '>' make an ajax post request to passing act=insert in php action file you can very well get this POST and perform an insert and display song inserted in your list. similar will happen for < you need to change the query .i didn't get you exactly where you got stucked... Regards Quote Link to comment Share on other sites More sharing options...
Northern Flame Posted February 20, 2008 Author Share Posted February 20, 2008 well i've looked up ajax tutorials on google but all they seem to do is show you how to do certain projects, i just want a link to someplace the lists the ajax function needed to do this and a simple example on how to use it. Thanks for the reply Quote Link to comment Share on other sites More sharing options...
priti Posted February 20, 2008 Share Posted February 20, 2008 Hi, I had never came across with exact example which mataches your requirement ....... sorry Quote Link to comment Share on other sites More sharing options...
Northern Flame Posted February 20, 2008 Author Share Posted February 20, 2008 well i am not asking for an exact example, but just somewhere where i can see the basic commands needed to do something like this. Quote Link to comment Share on other sites More sharing options...
Northern Flame Posted February 21, 2008 Author Share Posted February 21, 2008 Never mind i found what i was looking for. Quote Link to comment Share on other sites More sharing options...
priti Posted February 21, 2008 Share Posted February 21, 2008 gr8 kindly share the link :-) Quote Link to comment Share on other sites More sharing options...
Northern Flame Posted February 26, 2008 Author Share Posted February 26, 2008 http://www.w3schools.com/ajax/ajax_source.asp Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.