Overview
Examples
Screenshots
Comparisons
Applications
Download
Documentation
Tutorials
Bazaar
Status & Roadmap
FAQ
Authors & License
Forums
Funding Ultimate++
Search on this site
Search in forums












SourceForge.net Logo
Home » U++ Library support » U++ SQL » SQL Error[SOLVED]
SQL Error[SOLVED] [message #3307] Fri, 19 May 2006 01:28 Go to next message
Justin is currently offline  Justin
Messages: 57
Registered: March 2006
Location: Orange County California
Member
Mirek,

I am trying to get this code to work based on what you sent me earlier in my last post. But as you can see in the .LOG file, the values are appending a certain number of 'Free' strings after the values. What is this about?

The first piece of code is my code in the program and the second is the error from the log file.


sql.Execute("UPDATE nc_support SET name = ? WHERE ticket = ?",~supportmodify.edtName,AsString(ticket));




select substring_index(USER(),'@',1)
select substring_index(USER(),'@',1)
ERROR You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'reeF WHERE ticket = "640641877"eFreeFreeF' at line 1: UPDATE nc_support SET name = "45w"reeF WHERE ticket = "640641877"eFreeFreeF
UPDATE nc_support SET name = ? WHERE ticket = ?
## ERROR: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'reeF WHERE ticket = "640641877"eFreeFreeF' at line 1




Justin

[Updated on: Mon, 22 May 2006 19:12]

Report message to a moderator

Re: SQL Error [message #3309 is a reply to message #3307] Fri, 19 May 2006 02:27 Go to previous messageGo to next message
mirek is currently offline  mirek
Messages: 13975
Registered: November 2005
Ultimate Member
Justin wrote on Thu, 18 May 2006 19:28

Mirek,

I am trying to get this code to work based on what you sent me earlier in my last post. But as you can see in the .LOG file, the values are appending a certain number of 'Free' strings after the values. What is this about?

The first piece of code is my code in the program and the second is the error from the log file.


sql.Execute("UPDATE nc_support SET name = ? WHERE ticket = ?",~supportmodify.edtName,AsString(ticket));




select substring_index(USER(),'@',1)
select substring_index(USER(),'@',1)
ERROR You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'reeF WHERE ticket = "640641877"eFreeFreeF' at line 1: UPDATE nc_support SET name = "45w"reeF WHERE ticket = "640641877"eFreeFreeF
UPDATE nc_support SET name = ? WHERE ticket = ?
## ERROR: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'reeF WHERE ticket = "640641877"eFreeFreeF' at line 1




Justin



Frankly, looks like the bug in MySql code... "Free" is uninitalized memory.

Please try insert one line around MySql.cpp 189 and report success...

		case STRING_V: {
				String v = r;
				StringBuffer b(v.GetLength() * 2 + 3);
				char *q = b;
				*q = '\"';
				int n = mysql_real_escape_string(mysql, q + 1, v, v.GetLength());
				q[1 + n] = '\"';
				b.SetCount(2 + n); //TODO - check this fix
				p = b;
			}
			break;


Mirek
Re: SQL Error [message #3382 is a reply to message #3309] Mon, 22 May 2006 17:45 Go to previous message
Justin is currently offline  Justin
Messages: 57
Registered: March 2006
Location: Orange County California
Member
Sorry for the delayed response. I was just able to try your suggestion and everything worked perfectly. Thanks
Previous Topic: SQL, U++, and Escape Characters[SOLVED]
Next Topic: Securing MySQL Traffic
Goto Forum:
  


Current Time: Fri Apr 19 01:20:25 CEST 2024

Total time taken to generate the page: 2.94024 seconds