Re: How to modify a value in one of the field while fetching MySQL???
Posted by: Adam Donnison
Date: September 05, 2011 11:09PM

If you want to update the value in the database, you need to use an UPDATE statement. If you are just asking about updating the value received in code then you have a few problems there, specifically:

char * row_s;
_itoa(row_num,row_s,strlen(row_s)+1);

This is a segfault waiting to happen. I'm not sure of the specifics of the compiler you are using, but itoa expects three parameters, the integer, a pointer to an array that exists and is long enough for the resulting formatted string and an integer indicating the base for the arithmetic conversion. Normally this would be 10 if you want decimal. You are passing a pointer to uninitialised space and a value based on that unitialised memory.

Webmaster - http://www.SkySQL.com/

Options: ReplyQuote


Subject
Views
Written By
Posted
Re: How to modify a value in one of the field while fetching MySQL???
1868
September 05, 2011 11:09PM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.