CalcBuilder Forum

Getting names and values from database

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


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


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.

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

Thank you! )


Create dynamic calculators

Buy now!
Support/development 10 hours

Get a bigger amount of hours for more complex tasks and get a 10% discount

Buy now!