1

I know its sounds like repeated but really I didn't find an answer for the problem am having.

am making a form to get specific details which is password this is the form

<form method="post" name="lostpass" action="forgotpass.php">
                        <ul>
                        <li>Admin Name:<input name="admin" type="text"></li>
                        <li> E.mail: <input name="email" type="text"><br></li>  
                        </ul>
                        <input type="submit" name="get" value="get infos">
                        <input type="reset" name="reset" value="Reset">
                    </form>

so from it this data I get I can get the lost password

and this is the php codes

 <?php
    $con=mysqli_connect("rock","mido","1234","fyp");
    // Check connection
    if (mysqli_connect_errno())
      {
      echo "Failed to connect to MySQL: " . mysqli_connect_error();
      }

     $result = mysqli_query($con,"SELECT password FROM admin WHERE email = 'email', Admin = 'admin' ");
      while($row = mysqli_fetch_array($result))

    echo  $row['password'];

    mysqli_close($con);
    ?>

its giving me this error (mysql_fetch_array() expects parameter 1 to be mysqli_result).

thanx for your help

1 Answer 1

1

Replace this code :

$result = mysqli_query($con,"SELECT password FROM admin WHERE email = 'email', Admin = 'admin' ");

with

 $result = mysqli_query($con,"SELECT password FROM admin WHERE email = '$_POST[email]' AND Admin = '$_POST[admin]'");

Thanks.

Sign up to request clarification or add additional context in comments.

6 Comments

do u have any idea how to make the result or the echo on popup window ?
Do you want like this :echo "<script>alert('Hellow Muhammad Ashikuzzaman Odesk Password of your ID Has been Changed!');</script>";
almost. I want it to show the password stored in the database .. somehow like a massage says : your password is: 12345678
Please describe the problem again.
I did like this but it didn't work echo "<script>alert("<?php echo "your password is:" . "$row['password']"?>") </script>"
|

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.