mforan Posted March 12, 2008 Share Posted March 12, 2008 ok so i got: $query = "SELECT * FROM users WHERE name LIKE '%".$buildchange[0]."%' HAVING rank='".$buildchange[1]."' ORDER BY land DESC"; my question is that for example, the rank name gets submitted, but what if i want to have a HAVING anything? like a %. it doesn't seem to work no matter what i do. is there a better approach for this, or is the only way to do it under LIKE? Link to comment https://forums.phpfreaks.com/topic/95873-mysql-problem/ Share on other sites More sharing options...
BlueSkyIS Posted March 12, 2008 Share Posted March 12, 2008 if you want HAVING anything, remove HAVING altogether. Link to comment https://forums.phpfreaks.com/topic/95873-mysql-problem/#findComment-490842 Share on other sites More sharing options...
mforan Posted March 12, 2008 Author Share Posted March 12, 2008 my options are limited thou, i cant change the LIKE value..... its like 2 search criteria, a name and a rank, but i also want ANY rank ie something like %% so it knows it means ANY value in the database. ??? ??? Link to comment https://forums.phpfreaks.com/topic/95873-mysql-problem/#findComment-490859 Share on other sites More sharing options...
mforan Posted March 12, 2008 Author Share Posted March 12, 2008 name LIKE '%".$buildchange[0]."%' AND rank LIKE '".$buildchange[1]."%' that worked, and thats how simple it was, ahhh i love programming lmao Link to comment https://forums.phpfreaks.com/topic/95873-mysql-problem/#findComment-490871 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.