Php Codeigniter - Algorithm for generating string base from database data

Asked

Viewed 57 times

1

Good night guys, how are things? Let’s get to my problem.

I have the data saved this way in the database: banco de dados

Basically a project has TERMS related to it. Terms in turn may have synonyms.

I want my return to be as follows (see print 2)

("$termo" OR "$sinonimo") AND ("$termo" OR "$sinonimo")

This case will only apply if I have two terms with one synonym each. There may happen to be only one term without synonym, or several terms and some with others without synonyms.

Here’s an image of what the view would look like and how it should run.

inserir a descrição da imagem aqui

In this example the first term has two synonyms, the second term only one.

What would be the best way to solve what I want. My knowledge is limited to php and gambiarras de js (ajax).

Thank you since <3

No answers

Browser other questions tagged

You are not signed in. Login or sign up in order to post.