Jump to content

New To AJAX - Update Database, Update XML File, Update Page!


Northern Flame

Recommended Posts

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!

Link to comment
Share on other sites

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

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.