Jump to content

Recommended Posts

Posted

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 ;) <======

Posted (edited)

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
Posted

Umm, make sure you are passing the correct parameters to the _MySQLConnect function, after that line add some error checking, see what @error, $SQL_connex, and _MySQL_Error($SQL_connex) contains.

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
  • Recently Browsing   0 members

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