Guest User

Untitled

a guest
May 27th, 2018
87
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.71 KB | None | 0 0
  1. system("cls");
  2. char sentencia[] = "SELECT * FROM c_alumnos WHERE Carnet='%s'";
  3. MYSQL_RES *res;
  4. MYSQL_ROW row;
  5.  
  6. std::cout<<"EDITAR DATO ALUMNO"<<std::endl;
  7.  
  8. std::cout<<"Ingrese Carnet de Alumno"<<std::endl;
  9. std::cin>>alum.carnet;
  10.  
  11.  
  12. consulta = new char[strlen(sentencia)+strlen(alum.carnet)];
  13. sprintf(consulta, sentencia, alum.carnet);
  14. res = mysql_store_result(ObjDatos);
  15.  
  16. if(mysql_store_result(ObjDatos)>0)
  17. {
  18. row = mysql_fetch_row(res);
  19. sprintf(alum.carnet, "%s", row[0]);
  20.  
  21. std::cout << "Ingrese direccion: ";
  22. std::cin >> alum.Direccion;
  23.  
  24. mysql_free_result(res);
  25. }
  26. else
  27. std::cout << "Alumno no encontrado" <<std::endl;
  28. }
Add Comment
Please, Sign In to add comment