List:General Discussion« Previous MessageNext Message »
From:Eric Smith Date:February 26 2006 3:32am
Subject:mysql_real_query.... probably asked a lot
View as plain text  
OK, I'll bet you guys get a lot of this one, but I can't seem to find  
the answer in the archives.

I have binary data that I want to store in a longblob.  This is just  
byte data.... null bytes are possible.  So, I use mysql_real_query.   
How do I format the char* query string?

Here's the way my format looks:
sprintf(queryString,"update images set imageData=%p where imageID=\'%s 
\'",imageData,[imageID cString]);

and then I do the query:
result = mysql_real_query(theConnection,queryString,strlen(theDBData) 
+nBytes);

where strlen(theDBData)+nBytes gives the total byte count for  
queryString.  Well, I get an error message saying that I have an  
error in my syntax.  How do I format this properly?

Thanks,
Eric
Thread
mysql_real_query.... probably asked a lotEric Smith26 Feb
  • Re: mysql_real_query.... probably asked a lotLudwig Pummer26 Feb