Moonsoft Software Solutions

Getting names and values from database

Started 14 Mar 2012 · 2 replies

  1. moon_362
    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!
  2. Moonsoft support
    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.
  3. moon_362
    Thank you! )

Still stuck?

Customers with an active license can open a support ticket.

Log in to open a ticket