Page 1 of 1

How to search a profile with photos only?

Posted: Wed Nov 19, 2008 5:47 am
by rasmita
Help me with the code.....
if($_GET["action"]=='search')
{
$q="t2.is_default=1 ";
if($country_id=$_POST['country_id'])
$q .=" and t1.country_id='" . $country_id . "'";
if($sex1=$_POST['sex1'])
$q .=" and t1.sex1='" . $sex1 . "'";
if($agefrom=$_POST['agefrom'])
$q .=" and t1.age1>='" . $agefrom . "'";
if($ageto=$_POST['ageto'])
$q .=" and t1.age1<='" . $ageto . "'";
if($is_online=$_POST['is_online'])
$q .=" and t1.is_online ='" . $is_online . "'";
if($key=$_POST['key'])
$q .=" and ( t1.m_user like '%".$key."%' or t1.f_name like '%".$key."%' or t1.l_name like '%".$key."%')";
if($relation=$_POST['relation'])
$q.=" and t1.rel_name='".$relation."'";
if($is_picture=$_POST['is_picture'])
$q .=" and t2.pic_name<>'noimg1.gif'";


this code I have to use for search profile in my project.
Can anyone suggest me a way to search for only photos, excluding the default images like noimg.gif or noimg1.gif.

pic_name is the name of attribute in table where images are stored.

is_picture is a variable name.

Re: what "<>" stands for in php syntax?

Posted: Wed Nov 19, 2008 6:01 am
by aceconcepts
Using "<>" in a query means NOT EQUAL TO. The opposite of "="

Re: what "<>" stands for in php syntax?

Posted: Wed Nov 19, 2008 6:15 am
by jayshields
It's an SQL operator, not PHP syntax.