Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6098511
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T13:10:01+00:00 2026-05-23T13:10:01+00:00

I have a table in mysql having two fileds title_en,title_es If language is ENGLISH

  • 0

I have a table in mysql having two fileds title_en,title_es
If language is ENGLISH then title_en is required and title_es is optional.
If langauge is SPANISH then title_Es is required and title_en is optional while entring form data.
NOTE: This is for data entry.

Most likely one filed will be empty.

In PHP i write dynamic query

$sql=’Select title_’.$lang.’ from product’;

If Language is English then it will be “Select title_en from product”.
If Language is Spanish then it will be “Select title_es from product”.

For Listing page IF LANGUAGE is SPANISH, i have an issue that for some records(Entered when language was English) title_es is empty.

I know it can be handled by fetching both and using PHP function that will check if title_es is empty then title_en whould be shown.

But i want to handle it in Mysql as all site is complete and at this point client make 1 title required and other optional, which in start was both required.

Please suggest only for mysql solution.

Thanks for reading this.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-23T13:10:01+00:00Added an answer on May 23, 2026 at 1:10 pm
    SELECT 
     case when title_es is null then title_en
        else title_es
    end as title
    FROM product
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Have two table in mysql database with table1 and table2, table1 id marks hodname
I have two mysql table Table 1 id email other fields Table 2 id
I have a table having two fields start_date and end_date. I need to display
I have a MySQL database table with two columns that interest me. Individually they
I have mysql table that has a column that stores xml as a string.
I have a table in MYSQL, with the fields, id, size and color. An
I have a table in MySQL that is titled accounts, inside of accounts I
I have a table in MySQL That looks like the following: date |storenum |views
I have the following table: mysql> SELECT * FROM `bright_promotion_earnings`; +----+----------+------------+----------+-------+ | id |
I have a table in mysql like this Name Result T1_09_03_2010 fail T2_09_03_2010 pass

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.