# Help in php / phpmyadmin

**URL:** <https://forum.freecodecamp.org/t/help-in-php-phpmyadmin/298371>\
**Category:** General\
**Created:** [July 25, 2019, 12:07pm UTC](https://forum.freecodecamp.org/t/help-in-php-phpmyadmin/298371 "2019-07-25T12:07:18Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![zalmarhoon15](https://avatars.discourse-cdn.com/v4/letter/z/9d8465/32.png) [@zalmarhoon15](https://forum.freecodecamp.org/u/zalmarhoon15)\
**Post date:** [July 25, 2019, 12:07pm UTC](https://forum.freecodecamp.org/t/help-in-php-phpmyadmin/298371/1 "2019-07-25T12:07:18Z")

</div>

Hello, im trying to create php code for my login page. It continuously shows incorrect password even if the password on the database is correct.

- PLEASE HELP

```auto
<?php
   
   $dbhost = 'localhost:3306';
   $dbuser = 'root';
   $dbpass = ' *********************';
   $conn = mysql_connect($dbhost, $dbuser, $dbpass);
   
   if(! $conn ) {
      die('Could not connect: ' . mysql_error());
   }
   else {
	if(isset($_POST['username']))
	{
        	$username= $_POST['username'];
        	$password= $_POST['password'];
        	$sql="select * from loginform where username='$username'AND password='$password'";
        	$result=mysql_query($sql);
    
    		if(mysql_num_rows($result)==1)
		{
        		echo " You Have Successfully Logged in";
        		exit();
    		}
    		else 
		{
        		echo " incorrect password";
        		exit();
    		}
        
   	}
  }
?>

```

---

<div class="post-metadata">

**Author:** ![ILM](https://sea3.discourse-cdn.com/freecodecamp/user_avatar/forum.freecodecamp.org/ilm/32/363239_2.png) [@ILM](https://forum.freecodecamp.org/u/ILM)\
**Post date:** [July 25, 2019, 12:11pm UTC](https://forum.freecodecamp.org/t/help-in-php-phpmyadmin/298371/2 "2019-07-25T12:11:34Z")

</div>

I’ve edited your post for readability. When you enter a code block into a forum post, please precede it with a separate line of three backticks and follow it with a separate line of three backticks to make easier to read.

See [this post](http://forum.freecodecamp.com/t/forum-code-formatting/25574) to find the backtick on your keyboard. The “preformatted text” tool in the editor (`</>`) will also add backticks around text.

**Note:** Backticks are not single quotes.

![markdown_Forums](https://sea3.discourse-cdn.com/freecodecamp/uploads/default/original/3X/4/b/4b9a26f0c243380dd84935f4e29b92e3ecee8d05.gif)

---

<div class="post-metadata">

**Author:** ![ILM](https://sea3.discourse-cdn.com/freecodecamp/user_avatar/forum.freecodecamp.org/ilm/32/363239_2.png) [@ILM](https://forum.freecodecamp.org/u/ILM)\
**Post date:** [January 16, 2021, 12:58pm UTC](https://forum.freecodecamp.org/t/help-in-php-phpmyadmin/298371/3 "2021-01-16T12:58:55Z")

</div>

Closed on January 16, 2021, 12:58pm UTC


