At the moment I have a normal ajax example that refers to an xml file.

This xml file is a conversion of a mysql database file I have.

Now I wish to cut out the middle man (xml) and refer straight to the database.

Any Ideas on how I would go about this? Possible examples?

I am not new to internet programming but I am new to the AJAX concepts.

Thankyou, Regards X

> Now I wish to cut out the middle man (xml) and refer straight to the database.

You can't, that's the entire point in choosing a data interchange format for the interface exposed. You can cut down the fat by choosing alternate formats like the very primitive comma separated values or a lightweight format most suited for Javascript clients called JSON.

If what I assumed here isn't the case with your application, post a sample request / response along with a bit of background on what you *actually* are trying to achieve.

I think you got the idea right SOS ill show you what I am trying to achieve and maybe you can tell me how best way to achieve it?

The search on cars specifically the MAKE > MODEL, see how there connected?
Side Note: I like how it lists the number of makes in brackets anyone know how this is done?
This is what I wish to achieve.
I have all my makes and models in a database which I transfered to an xml file to make an ajax example.
At the moment my ajax example is TYPING (eg. Type A and a list of Audi Acrua Etc pops up).
I am trying to convert it to comboboxes now, but having a problem on how to populate that box.
Dont know If I should be using javascript/php/etc at the moment im 'trying' to use php to populate it.
And once this is done, it repopulates the models combo box from the chosen make?
Now how should I aim about solving this problem?

Any leads and help will be much appreciated, I have ideas but I prefer to take the lessons off you pros :P

Thanks, Regards X

The thing they are doing is nothing special. To summarize it:
- User makes a selection from the primary SELECT box, MAKE in your case.
- An asynchronous request is made using the XHR [XML HTTP Request] Object i.e. an AJAX call.
- The request URI encapsulates all the information required for fetching the data for the secondary SELECT box, MODEL in your case.
- The request looks something along the lines of /models/?make=selectedMake
- Now, the representation returned by the server depends on how your application architecture is structured. Like I explained in my previous post, it can be a delimiter separated value, a JSON response or an XML response. As far as that site is concerned, I guess they are dealing with a delimiter separated response, something along the lines of: make1=qty1;make2=qty2;make3=qty3 .
- If using JSON, the above response can be structured as: {make1: qty1, make2: qty2, make3: qty3} .
- The advantage when dealing with JSON response is that it can be directly consumed by your client application by simply evaling the text returned [though eval is dangerous for real applications; use a Javascript JSON library]

var obj = eval(response);
for(var key in obj) {
  alert(key + " -> " + obj[key]); // make1 -> qty1 etc.

- The logic for interpreting the request and constructing a response obviously would be implemented in the server side language of your choice. A working knowledge of the same is assumed.

I guess this should be enough to get you started. For queries related to how exactly this would be implemented at the server, post in the relevant forum [e.g. PHP].

commented: Thanks for the detailed breakdown! +1

Thanks for the detailed breakdown!

I have gotten the idea of what you were saying just need to take it all in now.

You mentioned JSON over XML?

JSON freeware? hard to use? hard to learn?

When I get more freetime ill research your concept more and put it to work.

Thanks for the information :)

> JSON freeware? hard to use? hard to learn?

It's a data interchange format, not a software. :-)

Pretty easy to learn and use if you know Javascript object literals.

Thanks, for the help s.o.s.

Ill try some things when I get free this week and update the thread.

Thanks for your help :)