Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6634487
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T22:56:08+00:00 2026-05-25T22:56:08+00:00

I wonder whether someone may be able to help me please. I’ve put together

  • 0

I wonder whether someone may be able to help me please.

I’ve put together a form and php code (below) that allows an administrator to search for member records from a mysql database using the email address as the search criteria.

HTML Form

   <form name="memberpasswordresetform" id="memberpasswordresetform" method="post" action="search.php">
    <div class="container">
        <p align="justify">Member Details </p>
        <table width="100%" border="0" cellspacing="0" cellpadding="0">
            <tr>
                <td width="26%" height="25"><strong>Email Address </strong></td>
                <td width="4%">&nbsp;</td>
                <td width="70%"><input name="email" type="email" id="email" size="50" /></td>
            </tr>
            <tr>
                <td height="25"><strong>Confirm Email Address </strong></td>
                <td>&nbsp;</td>
                <td><input name="conf_email" type="email" id="conf_email" size="50" /></td>
            </tr>
            <tr>
                <td height="25"><label>
                    <input type="submit" name="Submit" value="search" />
                    </label></td>
                <td>&nbsp;</td>
                <td>&nbsp;</td>
            </tr>
            <tr>
                <td height="25">&nbsp;</td>
                <td>&nbsp;</td>
                <td>&nbsp;</td>
            </tr>

            <tr>
                <td height="25"><strong>First Name </strong></td>
                <td>&nbsp;</td>
                <td><input name="fname" type="text" id="fname" size="30" /></td>
            </tr>
            <tr>
                <td height="25"><strong>Last Name </strong></td>
                <td>&nbsp;</td>
                <td><input name="lname" type="text" id="lname" size="30" /></td>
            </tr>
            <tr>
                <td height="25">&nbsp;</td>
                <td>&nbsp;</td>
                <td>&nbsp;</td>
            </tr>
            <tr>
                <td height="25"><strong>New Password</strong></td>
                <td>&nbsp;</td>
                <td><input name="newpass" type="password" id="newpass" size="30" /></td>
            </tr>
            <tr>
                <td height="25"><strong>Confirm New Password </strong></td>
                <td>&nbsp;</td>
                <td><input name="conf_newpass" type="password" id="conf_newpass" size="30" /></td>
            </tr>
            <tr>
                <td height="25"><input type="submit" name="save" value="save" /></td>
                <td>&nbsp;</td>
                <td>&nbsp;</td>
            </tr>
        </table>
    </div>
</form>

PHP Script

<?php 
include("admin/link.php");
include("admin/opendb.php");
mysql_select_db ("userdetails"); 
$term = $_POST['email']; 
$sql = mysql_query("select forename, surname, email address from userdetails where emailaddress like '%$email%'"); 
while ($row = mysql_fetch_array($sql)){ 
echo '<br/> First Name: '.$row['forename']; 
echo '<br/> Last Name: '.$row['surname']; 
echo '<br/><br/>'; 
} 
?>

The search functionality works fine, but I can’t work out how to populate the forename and surname fields on my form from the records retrieved from my database. I’ve been looking for, and found examples on how to do this, if I want to simply show the data as a table, but I can’t find any that explain how to populate the fields in a form.

I just wondered whether it would be at all possible that someone could provide some guidance please on how I can do this.

Many thanks

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-25T22:56:09+00:00Added an answer on May 25, 2026 at 10:56 pm

    The previous answer will work fine if short tags are enabled on the server. You should stick to the long syntax as below in case you change hosting providers at a later date.

    <input name="fname" type="text" id="fname" size="30" value="<?php echo $row['surname']; ?>" />
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I wonder whether someone may be able to help me please. I've put together
I wonder whether someone may be able to help me please. I've put together
I wonder whether someone may be able to help me please. I've put some
I wonder whether someone could help me please. I have put together a form
I wonder whether someone may be able to help please. I'm trying to put
I wonder whether someone may be able to help me please with a error
I wonder whether someone may be able to help me please. I'm trying to
I wonder whether someone can help me please. I've put together this page, which
I wonder whether someone can help me please. I'm trying to put together a
I wonder whether someone may be able to help me please. I'm wanting to

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.