if ($sort) { $table_on=1; $linkurl="support"; # If phrase is only a contains search, add the % characters for the mysql query. if ($phrasetype == "contains") { $contains = "%$contains%"; } else { $contains = $contains; } if ($field != "") { $fieldquery = "and ($field LIKE '$contains')"; } if ($s_owner != '') { $ownerquery = "and s_owner like '$s_owner'"; } if ($field == 'contact') { $searchquery = "SELECT * FROM contacts WHERE 1 and (name LIKE '$contains') and (table_on!=1) ORDER by name"; } $andquery = "$fieldquery $ownerquery ORDER by $sort"; $tablequery = "and (table_on = $table_on)"; PRINT "