suess0r Posted January 5, 2007 Share Posted January 5, 2007 hi, my array works fine but at the end i want to add 'ORDER BY orlandofull.`club name`' any ideas?? I tried putting it after the implode but i've been getting nothing but errors..[quote]$tmpq = array(); $sql= 'SELECT * FROM orlandofull WHERE '; if($city != "") $tmpq[] = 'orlandofull.Club_Landmark = "'.$city.'" '; if($type != "") $tmpq[] .= 'orlandofull.'.$typeList[$type].' = "Yes" '; if($subtype != "") $tmpq[] .= 'orlandofull.'.$subtypeList[$subtype].' = "Yes" '; if($cost != "") $tmpq[] .= 'orlandofull.`'.$cost.'` = "Yes"'; $sql .= implode(' AND ',$tmpq);[/quote] Link to comment https://forums.phpfreaks.com/topic/32976-quick-implodearray-help/ Share on other sites More sharing options...
complex05 Posted January 5, 2007 Share Posted January 5, 2007 What errors are you getting? post them please. Link to comment https://forums.phpfreaks.com/topic/32976-quick-implodearray-help/#findComment-153538 Share on other sites More sharing options...
suess0r Posted January 5, 2007 Author Share Posted January 5, 2007 OK, at the end of the SQL statement i just want to add "ORDER BY orlandofull.`club name`" So on the implode after the $sql .= implode(' AND ',$tmpq); can i do something like $sql .= implode(' AND ', $tmpq 'ORDER BY orlandofull.`club name`'); or $sql .= (' ORDER BY orlandofull.`club name` '); Link to comment https://forums.phpfreaks.com/topic/32976-quick-implodearray-help/#findComment-153559 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.