I have been desperately trying to find a script that will help with an auto-population of list menus.

I am creating a form with country, state and city drop downs and obviously want the state populated when the country is selected and city when state is selected.

The problem is, all of the scripts I have seen pre-populate arrays with text for all the values either in the script itself or in a seperate text file.

eg.

Code:
city_states['Bangladesh'] = '|Dhaka||Barisal|Chittagong|Khulna|Rajshahi|Sylhet';
The problem I have is that my database holds 1.8 million cities/towns alone and script or text file of this would be around 90mb in size.

Does anyone know a script that will allow me to use PHP and mysql to do the script on the fly?