iceblox Posted July 19, 2007 Share Posted July 19, 2007 Hi All, I have a deals database and im trying to exclude rows of data from the database if the "NetworkName" equals "Pay As You Go" the query itself its pretty easier but i just cant get it to do it. Anyone know how to achieve this? $query = "SELECT * FROM deals WHERE Name = '$model1' ORDER BY TotalCost ASC LIMIT 15"; Link to comment https://forums.phpfreaks.com/topic/60869-exclude-data-from-query/ Share on other sites More sharing options...
akitchin Posted July 19, 2007 Share Posted July 19, 2007 MySQL provides the <> operator, which means "not equal to": $query = "SELECT * FROM deals WHERE Name = '$model1' AND NetworkName <> 'Pay As You Go' ORDER BY TotalCost ASC LIMIT 15"; Link to comment https://forums.phpfreaks.com/topic/60869-exclude-data-from-query/#findComment-302847 Share on other sites More sharing options...
cooldude832 Posted July 19, 2007 Share Posted July 19, 2007 also try and avoid the *(everything) for your fields instead take what you need so you don't over work your db Link to comment https://forums.phpfreaks.com/topic/60869-exclude-data-from-query/#findComment-302850 Share on other sites More sharing options...
iceblox Posted July 19, 2007 Author Share Posted July 19, 2007 Thanks guys worked a treat! On the same sortof topic when i include my comparison script onto another php page the £ symbol gets turned into a � why does it do this? And is there a fix? Cheers, Phil Link to comment https://forums.phpfreaks.com/topic/60869-exclude-data-from-query/#findComment-302883 Share on other sites More sharing options...
cooldude832 Posted July 19, 2007 Share Posted July 19, 2007 the symbol you are talking about can't be interpreted by ASCII encoding i believe you need to use UTF-8 unicode to get it to work. Link to comment https://forums.phpfreaks.com/topic/60869-exclude-data-from-query/#findComment-302889 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.