# Login to vb database

**URL:** <https://forum.kirupa.com/t/login-to-vb-database/195518>\
**Category:** Uncategorized\
**Created:** [August 1, 2006, 9:02am UTC](https://forum.kirupa.com/t/login-to-vb-database/195518 "2006-08-01T09:02:52Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![blazes](https://avatars.discourse-cdn.com/v4/letter/b/35a633/32.png) [@blazes](https://forum.kirupa.com/u/blazes)\
**Post date:** [August 1, 2006, 9:02am UTC](https://forum.kirupa.com/t/login-to-vb-database/195518/1 "2006-08-01T09:02:52Z")

</div>

Hey everyone. I have a vBulletin database and i’m making a login page to login, using the usernames and passwords from the database. The md5 hashes come out differently when I press login, than whats in the database. I need to know how to fix this. cuz i’m confused.

```php
$username = trim(addslashes($_POST['username']));
$password = md5(trim($_POST['password']));
$query = mysql_query("SELECT * FROM tablename WHERE username = '$username' AND password = '$password' LIMIT 1") or die(mysql_error());
$row = mysql_fetch_array($query);

```
