Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

ODBC Error Code = 01000 (General warning)

Status
Not open for further replies.

kelani

MIS
Nov 29, 2000
44
US
I am using COld Fusion on Solaris and MySQL. My query is the following:

<cfquery name=&quot;modify&quot; datasource=&quot;dbname&quot; dbtype=&quot;ODBC&quot; timeout=&quot;60&quot; username=&quot;username&quot; password=&quot;assword&quot; dbserver=&quot;localhost&quot; dbname=&quot;dbname&quot;>
UPDATE users SET fname=fname, lname=lname, city=city, state=state, zip=zip, email=email, site=site, kwds=kwds, priv=priv, site=site, url=url WHERE id=id</cfquery>

On another update query, I have this:

<CFQUERY name=&quot;logplus&quot; datasource=&quot;dbname&quot; username=&quot;username&quot; password=&quot;password&quot; dbserver=&quot;localhost&quot; dbname=&quot;dbname&quot;>
UPDATE users SET login=login+1
</CFQUERY>

And it works.

What's the problem here?
 
The first query as you have it written will update every record in the users table, but will update them with the information that's already there! Maybe that's what MySQL is trying to warn you about.....

Try it this way:
Code:
<cfquery name=&quot;modify&quot; datasource=&quot;dbname&quot; dbtype=&quot;ODBC&quot; timeout=&quot;60&quot; username=&quot;username&quot; password=&quot;assword&quot; dbserver=&quot;localhost&quot; dbname=&quot;dbname&quot;>
UPDATE users SET fname='#fname#', lname='#lname#', city='#city#', state='#state#', zip='#zip#', email='#email#', site='#site#', kwds='#kwds#', priv='#priv#', site='#site#', url='#url#' WHERE id=#id#</cfquery>
(using CF variables instead of just re-referencing the columns themselves....)

Hope this helps...

DM
 
Okay, I had had it the way you described with the same error previously, but I'm guessing the single quotes around the '#id#' was causing the problem?

Anyway, it works now. =)

I owe you a beer, DM. Thanks a million
 
If the ID was a numeric value, you're correct.. the single quotes should only be used around string or date/time values, not numbers....

Glad it's working now :)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top