How are query strings ordered by hierarchy (in backend). How do you know which one should be instantiated? What is a good way to set up conditions for this? For example in facebook you can have two arguments:
http://www.facebook.com/profile.php?id=49300915&sk=photos
OR one
http://www.facebook.com/profile.php?id=49300915
What is a good way to organize this?
Like would
<?php
if(isset($_GET['id'], $_GET['sk'])) {
// Query...
} else if(isset($_GET['id']) {
// Query...
}
?>
- I put the 2 args before the 1 arg so the 1 arg doesn’t override the 2 args if the 1 arg isset (weird sentence there…).
— How should this be ordered when you have tons of $_GET[‘variables’]? If I had 5 different arguments that could be passed, How would I order the conditions for which query is fired.
The order of a query string collection should not matter to you. This is not the same as a method signature.
How you deal with different combinations is up to you, and it would depend entirely on what you were doing.