کد PHP:
$p="select * from tblproduct where catid='$_GET['cat']' order by 'productid' desc";
به صورت بالاست ولی این کد شما مشکل امنیتی داره؛ SQL Injection.
کد زیر امن تره:
کد PHP:
function sqi( $value ){
if( get_magic_quotes_gpc() ){
$value = stripslashes( $value );
}
if( function_exists("mysql_real_escape_string") ){
$value = mysql_real_escape_string( $value );
}
else
{
$value = addslashes( $value );
}
return $value;
}
$cat= $_GET['cat'];
$cat= sqi($cat);
$p="select * from tblproduct where catid='$cat' order by 'productid' desc";