if((mysql_real_connect_yyy(&mysql,NULL,"root","password",dbname,0,NULL,0)==NULL))
{ fprintf(stdout,"error on connect: %s\n",mysql_error(&mysql));
exit(EXIT_FAILURE);
}
sqllen=sprintf(sql_str,"select field_name,fld_type,defa_val,fld_desc from fields_list where table_name='%s' and is_input_field='Y' and (db_name='%s' or db_name is NULL) ",tablename,dbname);
#ifdef DEBUG
prog_debug(sql_str,'Y');
#endif
if(mysql_real_query(&mysql,sql_str,sqllen)!=0)
{ fprintf(stdout,"error on query: %s\n",mysql_error(&mysql));
exit(EXIT_FAILURE);
}
while((row=mysql_fetch_row(res))!=NULL)
{
if(i!=0)
{ strcat(sql_str,", ");
strcat(value_str,", ");
}else
if(row[3]!=NULL && strcmp(row[3],"SIMG")==0) //if the field is a image field then, save image to image db, and get image id save here
{
}