I am a newbie and struggling to get the correct Column "Type". I really
appreciate if someone can shed some light here..
I have a table XXX which has 4 columns with types char(2), varchar(5),
int(10) and int(10) respectively.
But, when I use the following code, I don't get the correct type from
MYSQL_FIELD structure!!
int nSuccess = mysql_query ( (MYSQL*)m_hdb, "select * from XXX" );
if ( nSuccess == 0 ) {
MYSQL_RES *Result = mysql_store_res ult ( (MYSQL*)m_hdb );
if ( Result ) {
MYSQL_FIELD *msField;
for ( int i = 0; msField = mysql_fetch_fie ld ( m_Result ); i++ ) {
printf ( "Column Name is %s\n", msField->name );
}
}
}
When I am looking the msField->type values in the "Watch" window, I see
MYSQL_TYPE_LONG , MYSQL_TYPE_LONG , 1098016098 and 191985148
respectively!!
Am I missing something here or is there a problem with the call
Thanks in advance.
- Venkat
appreciate if someone can shed some light here..
I have a table XXX which has 4 columns with types char(2), varchar(5),
int(10) and int(10) respectively.
But, when I use the following code, I don't get the correct type from
MYSQL_FIELD structure!!
int nSuccess = mysql_query ( (MYSQL*)m_hdb, "select * from XXX" );
if ( nSuccess == 0 ) {
MYSQL_RES *Result = mysql_store_res ult ( (MYSQL*)m_hdb );
if ( Result ) {
MYSQL_FIELD *msField;
for ( int i = 0; msField = mysql_fetch_fie ld ( m_Result ); i++ ) {
printf ( "Column Name is %s\n", msField->name );
}
}
}
When I am looking the msField->type values in the "Watch" window, I see
MYSQL_TYPE_LONG , MYSQL_TYPE_LONG , 1098016098 and 191985148
respectively!!
Am I missing something here or is there a problem with the call
Thanks in advance.
- Venkat