test if input entered by user is exist in database or not
2 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
Han
le 31 Jan 2018
Réponse apportée : Walter Roberson
le 31 Jan 2018
Hi !
I try the following code on a single record and it's work now I have a table with employees id I want to test if the number entered by user is exist so he can sign in my system
Code:
a = get(handles.ID,'String');
conn = database.ODBCConnection('users','root','root');
x = exec(conn,'select ID from employee');
x = fetch(x);
x1=(x.Data);
L1 = strcmp(a,x1);
if L1 == 1
.
end
Please Can you HELP ME !
0 commentaires
Réponse acceptée
Walter Roberson
le 31 Jan 2018
x = exec(conn, sprintf('select ID from employee where ID=''%s''', a));
0 commentaires
Plus de réponses (0)
Voir également
Catégories
En savoir plus sur Database Toolbox dans Help Center et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!