Login with mysql

HMG Samples and Enhancements

Moderator: Rathinagiri

Post Reply
User avatar
vinipantanal
Posts: 4
Joined: Wed Apr 07, 2010 7:34 pm

Login with mysql

Post by vinipantanal »

Português

Olá galera,

Como ainda não vi na net um sistema de login com harbour e minigui, gostaria de postar meu exemplo, de inicio está tudo certinho, porém há um problema, não consigo fazer a consulta na tabela para efetuar o login, agradeço de coração se vocês sanarem esta dúvida.

Se alguém se interessar prometo que posto o sistema completo assim que for concluído.

Obrigado a todos.

English

Hello guys,

As I have not seen on the net with a login system and MiniGUI harbor, I would post my example, a start is all right, but there is a problem, can not do the query in the table to log in, thank you from heart remedy this doubt.

If anyone is interested I promise that put the entire system once it is completed.

Thank you all.

Español

Hola chicos,

Como no he visto en la web con un sistema de entrada y el puerto MiniGUI, que fijaría mi ejemplo, un comienzo está bien, pero hay un problema, no puede hacer la consulta en la mesa para iniciar sesión, gracias por poner remedio a corazón esta duda.

Si alguien está interesado me prometo que poner todo el sistema una vez que se haya completado.

Gracias a todos.
Attachments
Syx.zip
O sistema, para alterar as configurações basta alterar o arquivo .ini em anexo
(196.01 KiB) Downloaded 467 times
simple is the best!
User avatar
vinipantanal
Posts: 4
Joined: Wed Apr 07, 2010 7:34 pm

Re: Login with mysql

Post by vinipantanal »

Português
Caso vocês não tenham servidor Mysql instalado,
existe um servidor free online http://www.freesql.org/
basta fazer um cadastro e pronto.

English
f you have not installed MySQL server,
There is a free online server http://www.freesql.org/
just make a record and go.

Español
Si usted no ha instalado el servidor MySQL,
Hay una línea http://www.freesql.org/ servidor gratuito
sólo hacer un disco y se van.
simple is the best!
User avatar
Rathinagiri
Posts: 5471
Joined: Tue Jul 29, 2008 6:30 pm
DBs Used: MariaDB, SQLite, SQLCipher and MySQL
Location: Sivakasi, India
Contact:

Re: Login with mysql

Post by Rathinagiri »

Thanks a lot friend.

Here myself and Sudip have created a dbf-MySQL converter. There we have used some API functions for MySQL in one file namely sql.prg. :)
East or West HMG is the Best.
South or North HMG is worth.
...the possibilities are endless.
User avatar
luisvasquezcl
Posts: 1258
Joined: Thu Jul 31, 2008 3:23 am
Location: Chile
Contact:

Re: Login with mysql

Post by luisvasquezcl »

Gracias por tu aporte.
saludos cordiales,
luis vasquez
User avatar
vinipantanal
Posts: 4
Joined: Wed Apr 07, 2010 7:34 pm

Re: Login with mysql

Post by vinipantanal »

Português
olá galera,

percebi que a minigui é um pouco mais complexa do que o php, mas tenho certeza que aqui existe muitos membros que já devem ter conseguido isso.
é sobre a consulta no login.
Não estou conseguindo retornar o erro caso o login esteja incorreto, onde estou errando?

English
hello guys,

I realized that MiniGUI is somewhat more complex than PHP, but I'm sure there are many members here that should have already accomplished that.
is on the consultation on login.
I'm not getting the return error if the login is incorrect, where am I wrong?

español
hola chicos,

Me di cuenta que MiniGUI es algo más complejo que el PHP, pero estoy seguro de que hay muchos miembros de aquí que ya debería haber logrado eso.
está en la consulta sobre la entrada.
No estoy recibiendo el error de retorno si la entrada es incorrecta, cuando me equivoco?


Em php funciona assim / Php works well. / php funciona bien.

Code: Select all

$usuario1= $_POST['usuario']; 
$senha1 = $_POST['senha']; 
//faz a confirmação de nome e senha no db
$logar = mysql_query("SELECT * FROM login WHERE nome='$usuario1' AND senha='$senha1'") or die("erro ao selecionar");
LoginSyx.prg
Onde está o erro? / where is the mistake? / ¿dónde está el error?

Code: Select all

  #include "hmg.ch"
  
  declare window Login
  declare window Main
  
  Function login_sYx()
  Local oQuery
  local usuario1
  local senha1
  usuario1 := login.txtUsuario.Value
  senha1 := login.txtSenha.Value




          oQuery := oServer:Query("SELECT usuario FROM `login` where (usuario='"+usuario1+"' and senha='"+senha1+"')")

           If oQuery:NetErr()
  	       MsgInfo("Erro no login : " + oQuery:Error(),"SISTEMA")
             Return({})
          endif
          

          oQuery:Destroy()


  Login.Release
  Main.Maximize

  Return Nil
Obrigado a todos pela ajuda.
Thank you all for your help.
Gracias a todos por su ayuda.
simple is the best!
Post Reply