CalcBuilder Forum

Getting names and values from database

User moon_362 2012-03-14 20:09:04

Hello!

I have a mysql database with names of cities, each city has a zone value.
Please, help me to write SQL to get list values from database.

MySQL database name is 'tr_bilet'

Table name is 'city_zone'

Columns are 'city' and 'zone'

Thank you!

Moonsoft support 2012-03-15 09:41:22

Hello,

To fill results in option list using SQL you should 'name' columns as follows: To fill value at option list, use 'as mvkey' in SQL sentence and to get view Name use 'mvvalue'

Here are an example of an SQL to get all users from your joomla:

select id as mvkey, name as mvvalue from #__users


So you only have to replace table and column names for the ones on your database.


Hope this helps. Regards,

Moonsoft Team.

User moon_362 2012-03-15 10:43:36

Thank you! )

...
List Manager

Build different lists for your site

Buy now!
...
CalcBuilder

Create dynamic calculators

Buy now!