How to search a profile with photos only?

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
rasmita
Forum Newbie
Posts: 11
Joined: Wed Nov 19, 2008 5:38 am

How to search a profile with photos only?

Post 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.
Last edited by rasmita on Thu Nov 20, 2008 5:37 am, edited 3 times in total.
User avatar
aceconcepts
DevNet Resident
Posts: 1424
Joined: Mon Feb 06, 2006 11:26 am
Location: London

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

Post by aceconcepts »

Using "<>" in a query means NOT EQUAL TO. The opposite of "="
User avatar
jayshields
DevNet Resident
Posts: 1912
Joined: Mon Aug 22, 2005 12:11 pm
Location: Leeds/Manchester, England

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

Post by jayshields »

It's an SQL operator, not PHP syntax.
Post Reply