1 (edited by abouyahya527911 2015-09-26 20:00:53)

Topic: what s wrong ?? Login hash example with MySQL

why this happen when i try to use mysql with login Hash exemple ?
and even you enter the right username and password keep tell you it wrong ??!!!

Post's attachments

Attachment icon Capture.JPG 84.42 kb, 308 downloads since 2015-09-26 

Re: what s wrong ?? Login hash example with MySQL

I made small change for MySQL

Post's attachments

Attachment icon LoginEx with hash - MySQL.zip 39.49 kb, 784 downloads since 2015-09-26 

Dmitry.

3 (edited by abouyahya527911 2015-09-27 07:55:02)

Re: what s wrong ?? Login hash example with MySQL

1-  can i know whats the small change because i want to fix other project ?

2 - and about MySQL Connect window can we modify it i mean so we can change language and design on it ?

Thanks in advance >

Re: what s wrong ?? Login hash example with MySQL

1.
Changed lines:

s := VarToStr( SQLExecute('SELECT read FROM users WHERE (login = ''' + sUser + ''');') );
to
s := VarToStr( SQLExecute('SELECT `read` FROM users WHERE (login = ''' + sUser + ''');') );


s := VarToStr( SQLExecute('SELECT write FROM users WHERE (login = ''' + sUser + ''');') );
to
s := VarToStr( SQLExecute('SELECT `write` FROM users WHERE (login = ''' + sUser + ''');') );


SQLExecute('INSERT INTO users (login, password, read, write, remove, search, administrator) VALUES (''admin'', ''21232F297A57A5A743894A0E4A801FC3'', 1, 1, 1, 1, 1);');
to
SQLExecute('INSERT INTO users (login, password, `read`, `write`, remove, search, administrator) VALUES (''admin'', ''21232F297A57A5A743894A0E4A801FC3'', 1, 1, 1, 1, 1);');


because "read" and "write" are reserved words for MySQL.



2. It's planned.

Dmitry.

5 (edited by abouyahya527911 2015-09-27 10:45:51)

Re: what s wrong ?? Login hash example with MySQL

Thanks for ur help  but even after this changes keep sayin username and password wrong and when i swap to SQLite work fine anything missin here ??

6 (edited by abouyahya527911 2015-09-28 05:28:42)

Re: what s wrong ?? Login hash example with MySQL

Sorted after change MySQL data will be deleted so u can t access with login and password unless u add it manually bi import data
Thanks again