> If I have a form and post a value - say <cfinput name="domain"
> required="yes" message=" Please enter FQDN"> to a receiving
> page with a query as:
>
> <cfquery name="get_handle" datasource="testds">
> select handle, domain, tld
> from domains
> WHERE domain='#form.domain#'
> </cfquery>
>
> This works however the domain in the form is actually both
> the value in the database "domain" and "tld" so if I was to
> search hotchilli that would be fine - but I post the FQDN so
> "hotchilli.com" so I would need something like this:
>
> <cfquery name="get_handle" datasource="testds">
> select handle, domain, tld
> from domains
> WHERE domain AND tld='#form.domain#'
> </cfquery>
>
> WHERE domain AND tld='#form.domain#'
> Anyone have a solution to the above clause.
One way you could do this is to treat Form.domain as a list:
<cfquery name="get_handle" datasource="testds">
SELECT handle,
domain,
tld
FROM domains
WHERE domain = '#ListFirst(Form.Domain, ".")#'
AND tld = '#ListLast(Form.Domain, ".")#'
</cfquery>
Dave Watts, CTO, Fig Leaf Software
http://www.figleaf.com/
voice: (202) 797-5496
fax: (202) 797-5444
------------------------------------------------------------------------------------------------
Archives: http://www.mail-archive.com/[email protected]/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists or send a message
with 'unsubscribe' in the body to [EMAIL PROTECTED]