Page 1 of 1

Opposite to "LIKE" ?

Posted: Mon Jan 01, 2007 1:42 pm
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?

Posted: Mon Jan 01, 2007 1:54 pm
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?

SQL

Posted: Mon Jan 01, 2007 9:23 pm
by timclaason

Code: Select all

$sql = "SELECT * FROM hits WHERE therefer != '' AND therefer NOT LIKE '%dalehay.com%' ORDER BY therefer ASC";

Posted: Tue Jan 02, 2007 5:04 am
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).