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 8097975
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T21:55:45+00:00 2026-06-05T21:55:45+00:00

I have a MySQL database and with a php function i made a table

  • 0

I have a MySQL database and with a php function i made a table is created to view the content.
Now i have an image (a little red cross). Now i want that if the user click’s on the image a delete query is executed. But i don’t know how.

$column = array_keys($array[0]);

 echo "<table border='1'>";
            echo "<tr>";
            foreach($column as $title)
            {

                echo "<td width='100px'>$title</td>";

            }
            echo "</tr>";

            echo "<tr>";
            foreach($array as $row)
            {
                foreach($row as $item)
                {
                    echo "<td>$item</td>";
                }

                 echo '<td><img src="delete_button.png value="'.$row['id'].'"" /></td>'; //the button and the id as value
                echo "</tr>";
            }

            echo "</table>";
  • 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-05T21:55:47+00:00Added an answer on June 5, 2026 at 9:55 pm

    You would have to put a link on the image as such

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

    And then in your delete.php file or whatever other script you put, you retrieve the id with

    $_GET["id"]
    

    And you execute your query.

    I hope your site is secured and that not everyone or every crawler and hit that link though, make sure it is safe, and I would recommend adding a confirm box at the very least.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have the following serialized PHP array stored in a mySQL database: a:2:{i:2070;s:4:0.00;i:1901;s:4:1.00;} Now,
I have a form that searches a MySQL database using PHP. Currently, when a
I have a php file which retrieves data from a MySql database and display
I have a PHP-based site with bookings/appointments stored in a MySQL database. I want
I have a simple php file that gets info from mysql database display inside
I have a simple php page that displays data from a mysql database. I
I have a small application written in PHP and a mysql database hosted on
I have a php host, and a mysql database. from that i wish to
I am working on PHP and database MySQL. I have two tables in SQL
Suppose you have a messaging system built in PHP with a MySQL database backend,

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.