Reference a group of ID’s resulting from group_concat

Asked

Viewed 50 times

0

I have a select that returns me the equally repeated lines, along with the total. I need to reference this ID group to pass as argument.

The result of my query is the array below. Basically it counts how many lines have Papa Charlie in the text, and with group_concat informs me is ID’s.

Array(
    [0] => array(
            [count] => 3
            [text ] => Papa Charlie
            [ids  ] => 1,2,3
        )

)

It is precisely this group of ID’s (1,2,3) that will suffer an action. I did not want to have to pass the ID’s explicitly as for example submit.php?id=1,2,3.

I thought of creating a hash to the country text as an argument md5(text), but I don’t know if it would be the best option. It would be something like submit.php?hash=0f0b429bf93c7ee9696ae9541a02c10e.

What would be the most viable way to reference this group?

  • From what I understand you are making a GET request (via url) to pass the parameters, so your parameters will become explicit, doing a rash really is not the best solution. For parameters that you want to hide or are sensitive you should make a POST request. Serializing these parameters and passing via POST would be an interesting way. Some links that can help you: http://www.diegomacedo.com.br/understanding-a-diferenca-entre-metodos-get-e-post-no-php/ http://forum.imasters.com.br/topic/462266-resolvidojson-com-php/

  • you can explain which action will be performed on submit.php?

No answers

Browser other questions tagged

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