Opposite to "LIKE" ?

Questions about the MySQL, PostgreSQL, and most other databases, as well as using it with PHP can be asked here.

Moderator: General Moderators

Post Reply
Dale
Forum Contributor
Posts: 466
Joined: Fri Jun 21, 2002 5:57 pm
Location: Atherstone, Warks

Opposite to "LIKE" ?

Post by Dale »

Code: Select all

$sql = "SELECT * FROM hits WHERE therefer != '' AND therefer LIKE '%dalehay.com%' ORDER BY therefer ASC";
Now above doesn't show any blank entries and it will only show entries with 'dalehay.com' in the database, however is there a way to hide them entries? And only search for non-dalehay.com addresses?
User avatar
feyd
Neighborhood Spidermoddy
Posts: 31559
Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA

Post by feyd »

[url=http://forums.devnetwork.net/viewtopic.php?t=30037]Forum Rules[/url] Section 1.1 wrote:1. Select the correct board for your query. Take some time to read the guidelines in the sticky topic.
NOT LIKE?
timclaason
Forum Commoner
Posts: 77
Joined: Tue Dec 16, 2003 9:06 am
Location: WI

SQL

Post by timclaason »

Code: Select all

$sql = "SELECT * FROM hits WHERE therefer != '' AND therefer NOT LIKE '%dalehay.com%' ORDER BY therefer ASC";
User avatar
onion2k
Jedi Mod
Posts: 5263
Joined: Tue Dec 21, 2004 5:03 pm
Location: usrlab.com

Post by onion2k »

Slightly off-topic, and a bit of a personal annoyance more than anything else, but 'the' has no place in a column name. 'therefer' should be just 'refer' (or 'referer' if that's what it actually contains).
Post Reply