Learn, Share, Build

101
October 03, 2017, at 10:35 AM

Is it a bad idea to keep word translations for two languages ​​in one table? The table structure looks like this: id (char) lang1(char) lang2(char)

I choose the translation for the selected language in this way:

    $words = ['content_title_log_in', 'content_title_register_account', 'content_title_contact'];
$q = 'SELECT lang1 FROM language WHERE ';
foreach ($words as $key => $value) {
    if($key == 0)
        $q .= 'id='.$value;
    else
        $q .= ' OR id='.$value;
}

And I have a query. Will doing such an OR operator 100 times in one query will not slow down the database? Is this a good practice?

READ ALSO
Learn, Share, Build

Learn, Share, Build

I currently have a program that will run tests on a server and it will send the results to the testphp file

135
Learn, Share, Build

Learn, Share, Build

I am really struggling getting an login attempt to work on Laravel 55… I’m using a Wordpress Table(user_login, user_pass) with the default WP password hash

99
Learn, Share, Build

Learn, Share, Build

I am importing data from large CSV files and I would like to send to the browser messages about current processing phase, like 'Parsing CSV file

109
Learn, Share, Build

Learn, Share, Build

I have tried various PHP str_* functions, but can't find the right combination of replace, explode(), etcto do what I need

128