URLでデータベースから選択したいのですが、このために次の場合にこれを行います:
if (isset($_GET['class']) == 'dw')
{
$query = mssql_query("select * from [WebShop] where [category]='".secure($string)."' and [dw] > 0 order by credits asc");
}
if (isset($_GET['class']) == 'bk')
{
$query = mssql_query("select * from [WebShop] where [category]='".secure($string)."' and [bk] > 0 order by credits asc");
}
if (isset($_GET['class']) == 'fe')
{
$query = mssql_query("select * from [WebShop] where [category]='".secure($string)."' and [fe] > 0 order by credits asc");
}
if (isset($_GET['class']) == 'mf')
{
$query = mssql_query("select * from [WebShop] where [category]='".secure($string)."' and [mf] > 0 order by credits asc");
}
if (isset($_GET['class']) == 'dl')
{
$query = mssql_query("select * from [WebShop] where [category]='".secure($string)."' and [dl] > 0 order by credits asc");
}
if (isset($_GET['class']) == 'sum')
{
$query = mssql_query("select * from [WebShop] where [category]='".secure($string)."' and [sum] > 0 order by credits asc");
}
if (isset($_GET['class']) == 'rf')
{
$query = mssql_query("select * from [WebShop] where [category]='".secure($string)."' and [rf] > 0 order by credits asc");
}
else
{
$query = mssql_query("select * from [WebShop] where [category]='".secure($string)."' order by credits asc");
}
この URL は次のとおりです。index.php?sy=items&class=dw
しかし、私がこのURLにアクセスするindex.php?sy=items&class=dw
と、:(の場合は最後に選択されます:index.php?sy=items&class=rf
それぞれの if で作業を解決するのに役立ちますか?