The SitePoint Forums have moved.

You can now find them here.
This forum is now closed to new posts, but you can browse existing content.
You can find out more information about the move and how to open a new account (if necessary) here.
If you get stuck you can get support by emailing forums@sitepoint.com

If this is your first visit, be sure to
check out the FAQ by clicking the
link above. You may have to register
before you can post: click the register link above to proceed. To start viewing messages,
select the forum that you want to visit from the selection below.

functions in MySQL

Hello,

I just started to use stored functions in MySQL. I want to send a parameter to a function as a string (ex.: 'en') and in the function to have SELECT en FROM one_table. That en is not hardcoded, it must come from a parameter sent in function. Is better to watch the code below (check the update and insert statements, watch for language_)

About the root
The database is just on my machine and it's used for development only. But you are right, I should change it otherwise I'll have some problems when I'll transfer functions on the real machine.

About the table structure
I'l describe in a few words why I use this structure: I get from an XML some city names translated in several languages. Bucharest (in English) is different by Bucarest (in Italian) and this is my only idea about storing these values. If you have a better solution I'll be happy to implement it.