Jump to content

SQL Problem


 Share

Recommended Posts

Hello everyone

I had some problems in recovering some MySQL data:

In my case, I want to recover a password in the form of hash from a MySQL database from a user name ...

Here is a piece of my code:

$SQL_connex = _MySQLConnect($SQL_conf[3][1],$SQL_conf[4][1],$SQL_conf[2][1],$SQL_conf[1][1])
$connex_SHA = _SHA1(GUICtrlRead($connex_pass))
$SQL_Code = "SELECT `user_pass` FROM `user` WHERE `user_login` LIKE "'& GUICtrlRead($connex_user) &'";"
$code = _Query($SQL_connex,$SQL_Code)
IniWrite("contacts.ini", "TEST", "USER", $code)

In short, the only thing is the file register is : "" ...

When I execute the query directly on the server, it returns me directly the good result ... in short it's a bug in my code ...

Can you help me?

Thank you in advance!

Tom.

P.S : Sorry for my English, I'm french ^^!

======> Tomy ... just for fun ;) <======

Link to comment
Share on other sites

1) use = instead of LIKE in this case

2) mismash in quotes/double quotes

original

$SQL_Code = "SELECT `user_pass` FROM `user` WHERE `user_login` LIKE "'& GUICtrlRead($connex_user) &'";"

try this

$SQL_Code = "SELECT `user_pass` FROM `user` WHERE `user_login` LIKE '" & GUICtrlRead($connex_user) & "';"

or this

$SQL_Code = "SELECT `user_pass` FROM `user` WHERE `user_login` = '" & GUICtrlRead($connex_user) & "';"
Edited by Zedna
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...