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()); Quote 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 Quote 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 Quote 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 != Quote Link to comment https://forums.phpfreaks.com/topic/157202-solved-select-help/#findComment-828370 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.