Olpweawbstpzl
New Member
I have a list of cities.\[code\]<select name="cities"> <option value="http://stackoverflow.com/questions/14052891/nc">New city..</option> <option value="http://stackoverflow.com/questions/14052891/quetta">Quetta</option> <option value="http://stackoverflow.com/questions/14052891/karachi">Karachi</option> <option value="http://stackoverflow.com/questions/14052891/islamabad">Islamabad</option> <option value="http://stackoverflow.com/questions/14052891/khyber pukhtun khuan">Khyber Pukhtun Khuan</option> <option value="http://stackoverflow.com/questions/14052891/multan">Multan</option> <option value="http://stackoverflow.com/questions/14052891/murree">Murree</option> <option value="http://stackoverflow.com/questions/14052891/gwadar">Gwadar</option> <option value="http://stackoverflow.com/questions/14052891/gujranwala">Gujranwala</option> <option value="http://stackoverflow.com/questions/14052891/faisalabad">Faisalabad</option> <option value="http://stackoverflow.com/questions/14052891/peshawar">Peshawar</option></select>\[/code\]And i have a database in which i have stored user's city. Now i am making a page in which the user will update his city and for that i want the user to see his city already selected when he opens up the page. In short, i want a option to be selected according to the value returned by the database. I am using php as the languageI had got one solution but not implemented it yet because its not effecient! Any easy and effecient way would be appreciated.Thanks in advance