Jump to content

daft query issue


wmguk

Recommended Posts

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

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

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.