> Ok, what i am trying to do is add a column in my database that
> would contain
> "Keywords" for a search.
>
> What i am trying to do is add values from the data entered in the
> form from
> the previous page to one field in the database
>
> I only get a value of "-1" ????? is there something i am doing wrong???
>
> <CFQUERY datasource="search">
> INSERT INTO search(keywords)
> VALUES('#name#' AND '#address#' AND '#phone#')
> </CFQUERY>
OK, since nobody has explained why you get the -1, here goes
The value you're creating is turned into a logical by the ANDs, instead of
doing something with the strings, you're in effecting doing boolean ANDs on
the strings, which produce the value of -1
Why not create 3 fields, then search for the string on these fields with an
OR;
SELECT * FROM keywords
WHERE Name='#myString#' OR Address='#myString#' OR Phone='#myString#'
Of course, the easier method would be to use Verity, but then you have to
let it update as soon as you insert the record (which might cause it
problems)
If you want to search for part of the fields, then you'll probably have to
use LIKE
WHERE Name LIKE '%#myString#%' OR Address LIKE '%#myString#%' OR Phone
LIKE'%#myString#%'
HTH
Philip Arnold
ASP Multimedia Limited
T: +44 (0)20 8680 1133
"Websites for the real world"
**********************************************************************
This email and any files transmitted with it are confidential and
intended solely for the use of the individual or entity to whom they
are addressed. If you have received this email in error please notify
the system manager.
**********************************************************************
------------------------------------------------------------------------------
Archives: http://www.eGroups.com/list/cf-talk
To Unsubscribe visit
http://www.houseoffusion.com/index.cfm?sidebar=lists&body=lists/cf_talk or send a
message to [EMAIL PROTECTED] with 'unsubscribe' in the body.