This topic is locked

View records according to selected application language

8/23/2010 12:01:15 PM
PHPRunner General questions
I
itmann author

Hello Forum,
I have a table (News) which contains a column (Language) this is where the employees put the language of the news they post.. please see screenshot

I created the application in 3 Languages. I need a snapset/event which shows only the records of the table(News) according to the application language selected by user.

Ps. Don't forget to mention where to put the event

I'd appreciate a quick help
thanks

Sergey Kornilov admin 8/23/2010

Use 'Dynamic SQL query' technique described at http://xlinesoft.com/phprunner/docs/modify_sql_query_on_the_fly.htm
The current selected language is stored in $_SESSION["language"]. More info on session variables: http://xlinesoft.com/phprunner/docs/phprunner_session_variables.htm
Sample code:

$strWhereClause = whereAdd($strWhereClause, " Language='" . $_SESSION["language"] . "'");