php - Get MySQL row with HTML textbox, return column -


i have mysql database containing table called hashes_md5 these columns: plain,hash. want make simple php script user inputs text within textbox. php script should text in column 'plain' , if exists, return value column 'hash' corresponding row. have connection mysql server done:

<?php $connection = mysql_connect("localhost", "root","password"); or die ("error occured. credentials correct?");  mysql_select_db("hashes") or die ("error occured. database doesn't exist.");  $query = "select plain, hash hashes_md5"; $result = mysql_query($query); while($row = mysql_fetch_object($result))    {    echo "$row->plain, $row->hash <br>";     } ?> 

how can this?

and have done?
here sql command rest you:

 select hash hashes_md5 plain='$plain_escaped_hash' 

but sure? hash 1 way encoding, can md5() input , print out! if user wants crack hash can enter hash , can search him in database equal plain text of hash !


Comments

Popular posts from this blog

google chrome - Developer tools - How to inspect the elements which are added momentarily (by JQuery)? -

angularjs - Showing an empty as first option in select tag -

php - Cloud9 cloud IDE and CakePHP -