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

  • SEARCH
  • Home
  • 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 8068831
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T12:49:08+00:00 2026-06-05T12:49:08+00:00

I need a form that allows a user to edit data from an SQL

  • 0

I need a form that allows a user to edit data from an SQL database.

The main page of my form contains a table where any available data is shown and, also, there are edit and delete options available. Sample:

{
$row=mysql_fetch_array($result);
echo "<tr>";
echo "<td>".$row["name"]."</td>";
echo "<td>".$row["occuptation"]."</td>";
echo '<td><a href="edit.php"><img src="edit.png"/></a></td>';
echo '<td><a href="delete.php"><img src="delete.png"/></a></td>';
echo "</tr>";
}

When the user clicks the edit.png I need it to direct to edit.php where the data from the whole row selected (whichever row the user chooses to click edit or delete from) shows up in a form (like default values). I have no idea how to achieve this.

Any help is appreciated! Please tell me if i’m being confusing and I will try to explain further.

  • 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-06-05T12:49:09+00:00Added an answer on June 5, 2026 at 12:49 pm

    What you’ll want to do is include an identifier as a query string parameter in the edit and delete links:

    echo '<td><a href="edit.php?id=' . $row["id"] . '"><img src="edit.png"/></a></td>';
    echo '<td><a href="delete.php?id=' . $row["id"] . '"><img src="delete.png"/></a></td>';
    

    (Of course, I’m assuming the name of your identifier. But you get the idea.)

    This will tell those pages which record they should display. The pages would get the identifier with:

    $_GET["id"]
    

    A few things you’ll want to consider:

    • Make sure to check for a proper identifier value in $_GET["id"] before you try to do anything with it. Never assume it’s valid without checking.
    • DO NOT simply concatenate the value into a SQL string. Use something like PDO to build queries with parameters. What you’re trying to avoid here is something called a SQL injection vulnerability.
    • Make sure the user is permitted to access the record in question for the operation in question (edit or delete) before you display anything. Never assume that the link came directly from something your code output on a page. Anybody can just as easily manually change the id value in the URL.
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I've got a form that allows the user to edit an employees information: name,
I need the form that will edit the array of entities and their related
I need to make the program which have one form that contains PNG image
I have an html/php form that updates entries on the database server. I need
My project has a reporting module that gathers data from the database in the
I have a form that allows a user to update their profile information, but
I have a form that allows a user to add an unlimited number of
I have a form that allows the user to choose a country. Depending on
I'm working on an application that has need of a form that allows the
I have a form that allows the user to add more form fields if

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.