CanMan2004 Posted November 8, 2006 Share Posted November 8, 2006 Hi allI have a simple query[code]$q = "SELECT * FROM logins WHERE name='$name'";[/code]Is it possible to make the query ignore a particular row id number?So the code would look something like[code]$q = "SELECT * FROM logins WHERE name='$name' WHERE id != '342'";[/code]That would select everything apart from id number 342Any help would be greatThanks in advanceEd Link to comment https://forums.phpfreaks.com/topic/26567-select-query-not-including-xx/ Share on other sites More sharing options...
Orio Posted November 8, 2006 Share Posted November 8, 2006 In SQL, the not-equal sign is not != like in PHP, it's <>. For exmaple:SELECT * FROM logins WHERE name='$name' AND id <> '342'(And you use the "AND" or "OR" oparetors, not multiply "WHERE")Orio. Link to comment https://forums.phpfreaks.com/topic/26567-select-query-not-including-xx/#findComment-121518 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.