Skip to content
Advertisement

How can I pass multiple parameters to identify a page?

I currently have one question and that is if I can pass 2 parameters in my url to identify a page.

Currently I have this code, which gets me through the parameter “url_slug” my post stored in the database.

So far everything works fine for me, but I would like to add that when I get the “url_slug” parameter I also get an extra parameter to identify the post more accurately, for example in the database.

DATABASE IMG

Currently the urls work this way => localhost/animales?url_slug=oso

—–

but since I added the new “tipo” column I would like the url to identify the posts this way => localhost/animales?url_slug=oso&tipo=panda | and send me to the post panda

and when I enter to = localhost/animales?url_slug=oso&tipo=polar | send me to the post polar

EDIT:

Advertisement

Answer

You can add tipo parameter to your selectPostBySlug and do the same thing fot the tipo query

User contributions licensed under: CC BY-SA
6 People found this is helpful
Advertisement