-1
Rephrasing the question:
I have a table in Mysql where I need to display the person’s name as soon as they type their ID. I’m making a code where I just try to do the search to see if you’re searching normally, but I can’t display this value on the screen.
Follows the code:
int main(){
MYSQL conexao;
int res;
int esco = 2;
char query[100];
mysql_init(&conexao);
if ( mysql_real_connect(&conexao, "localhost", "root", "", "teatro", 0, NULL, 0) ){
sprintf(query,"select tb_aluno_nome from tb_aluno where tb_aluno_rg = '999999999';");
res = mysql_query(&conexao,query);
if (!res)
printf("nome: %i",res);
system("pause");
return(0);
}
}
put the code of what has already been done or explain the situation better, to help visualize your problem
– Gabriel Gonçalves
Maybe taking out the
!
ofif (!res)
... the!
means "negative" (zero, null or empty), which seems to me to be the opposite of what you want.– Sam
In fact, the
!
means false– Sam
In fact, the
!
means not, nay? :-) -> C Operators– Pedro Gaspar