$profilefields=$DB_site->query("SELECT profilefieldid,title FROM profilefield"); while ($profilefield=$DB_site->fetch_array($profilefields)) { makeinputcode("and $profilefield[title] contains","field".$profilefield[profilefieldid]); }