Topic: Can some one help me with this script

so ... this code works with sqllite verry well but for some reason does`t work with a real mysql database.

procedure frmLogin_bLogin_OnClick (Sender: string; var Cancel: boolean);
var
   s: string;
begin
     // SQL query for check user and password
     s := VarToStr( SQLExecute('SELECT count(id) FROM users WHERE (login ='''+frmLogin.edUser.Text+''') AND (password ='''+frmLogin.edPassword.Text+''');') );

     // if SQL query found login and password
     if (s <> '0') and (s<>'') then
     begin
          sUser := frmLogin.edUser.Text; // remember username

          // check admin rights
          s := VarToStr( SQLExecute('SELECT administrator FROM users WHERE (login = '''+sUser+''');') );
          if s='0' then Meniu.alimentara.Enabled := False; // if the user does not have administrator privileges, deactivate the button to create other users

// check admin rights
          s := VarToStr( SQLExecute('SELECT administrator FROM users WHERE (login ='''+sUser+''');') );
          if s='0' then meniu.bAngajati.Enabled := False; // if the user does not have administrator privileges, deactivate the button to create other users

          // check permissions to read
          s := VarToStr( SQLExecute('SELECT citire FROM users WHERE (login ='''+sUser+''');') );
          if s='0' then Frmadduser.Button1.Enabled := False; // deactivate the button to edit the record

          // check write permissions
          s := VarToStr( SQLExecute('SELECT scriere FROM users WHERE (login ='''+sUser+''');') );
          if s='0' then
          begin
               frmUsers.add.Enabled := False;      // deactivate the button to add the record
               frmUsers.edit.Enabled := False; // deactivate the button to save the record
          end;

          // check permission to delete
          s := VarToStr( SQLExecute('SELECT stergere FROM users WHERE (login ='''+sUser+''');') );
          if s='0' then frmUsers.delete.Enabled := False; // deactivate the button to delete the record

          // check permission to search
          s := VarToStr( SQLExecute('SELECT cautare FROM users WHERE (login ='''+sUser+''');') );
          if s='0' then angajati.search.Enabled := False; // deactivate the button to search the records


          frmLogin.Close; // close login form
     end else MessageDlg('password is incorrect', mtError, mbOk, 0); // message if the password is incorrect

end;


// window closing event for login
procedure frmLogin_OnClose (Sender: TObject; var Cancel: boolean);
begin
     // if the user has not been defined, and the user closes the login window, then close the main form
     if sUser='' then Meniu.Close;
end;





begin
  // Initial check whether there is a database administrator user
  // if not, create an administrator with username admin and password admin
     if VarToStr( SQLExecute('SELECT count(id) FROM users WHERE administrator=1;') ) = '0' then
     begin
         SQLExecute('INSERT INTO users(login, `password`, `citire`, `scriere`, `stergere`, `cautare`, `administrator`) VALUES ("admin", "admin", 1, 1, 1, 1, 1);');
         frmLogin.edUser.Text := 'admin';
         frmLogin.edPassword.Text := 'admin';
     end;

end.

I can login , i can change user and so on but al login is not checking permisions for user and deactivate the apropiate buttons , it gives admin rights to every user.

Re: Can some one help me with this script

problem solved

Re: Can some one help me with this script

How explain to us too.

JUST LEARNING, O GOD HELP ME.