evandaeman
29 Jan 2007, 11:36 AM
hi... i have a couple of tables in my database...
i have database called leads with these fields
id
fname
lname
source
data example:
1, evan, lastname, http://www.google.com/search?blabla
1, evan, lastname, http://www.yahoo.com/search?damn
1, evan, lastname, http://www.msn.com/search?ding
1, evan, lastname, http://www.google.com/search?blueblue
i have a 2nd table called URL with these fields
id
url
data:
1, http://www.google.com
2, http://www.msn.com
now... i want to tell my php script...
if ($source LIKE %$url%) {
echo $fname;
}
i notice that i can't use LIKE statement when i use "if/else"
what do you think would be best way to match the data?
i know i can do a query in mySQL using LIKE statement...
but are there similar operators for IF/ELSE???
i have database called leads with these fields
id
fname
lname
source
data example:
1, evan, lastname, http://www.google.com/search?blabla
1, evan, lastname, http://www.yahoo.com/search?damn
1, evan, lastname, http://www.msn.com/search?ding
1, evan, lastname, http://www.google.com/search?blueblue
i have a 2nd table called URL with these fields
id
url
data:
1, http://www.google.com
2, http://www.msn.com
now... i want to tell my php script...
if ($source LIKE %$url%) {
echo $fname;
}
i notice that i can't use LIKE statement when i use "if/else"
what do you think would be best way to match the data?
i know i can do a query in mySQL using LIKE statement...
but are there similar operators for IF/ELSE???