dreamwest Posted May 7, 2009 Share Posted May 7, 2009 i cant figure out how to select "is not sumthing" ive tried: $result = mysql_query("SELECT id FROM video WHERE user_id NOT '1'") or die(mysql_error()); and $result = mysql_query("SELECT id FROM video WHERE user_id IS NOT '1' ") or die(mysql_error()); Link to comment https://forums.phpfreaks.com/topic/157202-solved-select-help/ Share on other sites More sharing options...
joozt Posted May 7, 2009 Share Posted May 7, 2009 Try: $result = mysql_query("SELECT id FROM video WHERE user_id <> '1' ") or die(mysql_error()); <> means not Link to comment https://forums.phpfreaks.com/topic/157202-solved-select-help/#findComment-828335 Share on other sites More sharing options...
kickstart Posted May 7, 2009 Share Posted May 7, 2009 Hi As above, but there are several ways to do this:- $result = mysql_query("SELECT id FROM video WHERE user_id != '1'") or die(mysql_error()); $result = mysql_query("SELECT id FROM video WHERE user_id <> '1'") or die(mysql_error()); $result = mysql_query("SELECT id FROM video WHERE NOT (user_id = '1')") or die(mysql_error()); $result = mysql_query("SELECT id FROM video WHERE user_id NOT LIKE '1'") or die(mysql_error()); I would say go for either of the first 2. All the best Keith Link to comment https://forums.phpfreaks.com/topic/157202-solved-select-help/#findComment-828352 Share on other sites More sharing options...
dreamwest Posted May 7, 2009 Author Share Posted May 7, 2009 Sweet thanks! I used != Link to comment https://forums.phpfreaks.com/topic/157202-solved-select-help/#findComment-828370 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.