Friday, 15 July 2011

php - when i enter only min value then it consider max as zero and return me null data -



php - when i enter only min value then it consider max as zero and return me null data -

when come in min value consider max 0 , homecoming me null data

$min=$_request['min']; $max=$_request['max']; $q3="select * product '$min' < `price` < '$max'"; $q=mysql_query($q3);

change query max value:

$min=$_request['min']; $max=$_request['max']; if( empty($max) ) $q3="select * product cost > '$min'"; else $q3="select * product cost > '$min' , cost < '$max' "; $q=mysql_query($q3);

one more correction should start using pdo . method using depreciated.

read this

php sql

No comments:

Post a Comment