wmguk Posted March 11, 2008 Share Posted March 11, 2008 hey, I keep getting a blank page, <? $order = $_GET['order']; $order2 = $_GET['order']; if $order = "" { $order = "albumname ASC"; } else { $order = $_GET['order']; } ?> page url is show.php and i want it to look, if show.php isnt passing $order in the URL then set $order as albumname ASC, if it is showing $order in the url then display the whole page.. what am i missing? Link to comment https://forums.phpfreaks.com/topic/95681-daft-query-issue/ Share on other sites More sharing options...
discomatt Posted March 11, 2008 Share Posted March 11, 2008 You have to use == singe = denotes definition, double = (==) checks for equality. Link to comment https://forums.phpfreaks.com/topic/95681-daft-query-issue/#findComment-489869 Share on other sites More sharing options...
wmguk Posted March 11, 2008 Author Share Posted March 11, 2008 I just had a play, realising the code was rough, and this is what i now have, <? $order == $_GET['order']; if $order == "" { $order == "albumname ASC"; } else { $order == $_GET['order']; } $order2 == $order ; ?> but still totally white page, Link to comment https://forums.phpfreaks.com/topic/95681-daft-query-issue/#findComment-489873 Share on other sites More sharing options...
Psycho Posted March 11, 2008 Share Posted March 11, 2008 Um, what? First off there is nothing in that code that would output anything to the page. Seconds, you changed the definitions to cmparisons as well (which shouldn't be). Third why would the code go through the logic to determine the value of $order, just to then define $order2 to be the same? <?php $order = (empty($_GET['order'])) ? "albumname ASC" : $_GET['order'] ; echo $order; ?> Link to comment https://forums.phpfreaks.com/topic/95681-daft-query-issue/#findComment-489884 Share on other sites More sharing options...
wmguk Posted March 11, 2008 Author Share Posted March 11, 2008 $order2 needs to be the same as $order, for use in a different script, however to make things simple i could just use the same variable name... Thanks for helping with that, I completely lost my way! Link to comment https://forums.phpfreaks.com/topic/95681-daft-query-issue/#findComment-489888 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.