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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T01:12:45+00:00 2026-06-11T01:12:45+00:00

Hope some one can help me out here, i guess am not calling my

  • 0

Hope some one can help me out here, i guess am not calling my functions right.
Am trying to retrieve some data from my database and have a delete link attached to each items being retrieved, so that when ever i click on delete, it will delete that particular item which have the delete function.

My Code to retrieve items from database are as follows.

<?php
$con = mysql_connect("localhost","root","");
mysql_select_db("uloaku", $con);
$count = 1;
$y = mysql_query("SELECT * FROM transaction");
if(mysql_num_rows($y) != 0){

echo "<table bgcolor=\"white\" width=\"1000\" bordercolor=\"grey\" border=\"5\" >";
echo "<tr>
<td align=\"center\">No</td>
<td align=\"center\">Date</td>
<td align=\"center\">Current Balance</td>
<td align=\"center\">Avaliable Balance</td>
<td align=\"center\">Account Status</td>
<td align=\"center\">Delete Account</td>

</tr>";

while ($z = mysql_fetch_array($y, MYSQL_BOTH)){
        echo "<tr>
        <td align=\"center\">".$count++."</td>
        <td align=\"center\">".$z[1]."</td>
        <td align=\"center\">".$z[2]."</td>
        <td align=\"center\">".$z[3]."</td>
        <td align=\"left\" width=\"300\">".$z[4]."</td>
        <td><a href=\"delete.php\">delete</a></td>
        </tr>";
    }
    echo "</table>";
    }
?>

And my code to delete

<?php
session_start();
$con = mysql_connect("localhost","root","");
mysql_select_db("uloaku", $con);
$id = $_GET['id'];
$sql = mysql_query("DELETE FROM transaction WHERE id='$id' LIMIT 1") or die   (mysql_error());
header("Location: vacct.php");
?>

I know am missing out the logic here and hope somebody can direct me or show me the easy way out. at the moment i can successfully retrieve my items from the data base my only problem is to be able to apply the delete function each time the delete button is tapped.

  • 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-11T01:12:46+00:00Added an answer on June 11, 2026 at 1:12 am

    Use the below code.I have added validation and encryption

    <?php
    $con = mysql_connect("localhost","root","");
    mysql_select_db("uloaku", $con);
    $count = 1;
    $y = mysql_query("SELECT * FROM transaction");
    if(mysql_num_rows($y) != 0){
    
    echo "<table bgcolor=\"white\" width=\"1000\" bordercolor=\"grey\" border=\"5\" >";
    echo "<tr>
    <td align=\"center\">No</td>
    <td align=\"center\">Date</td>
    <td align=\"center\">Current Balance</td>
    <td align=\"center\">Avaliable Balance</td>
    <td align=\"center\">Account Status</td>
    <td align=\"center\">Delete Account</td>
    
    </tr>";
    
    while ($z = mysql_fetch_array($y, MYSQL_BOTH)){
            echo "<tr>
            <td align=\"center\">".$count++."</td>
            <td align=\"center\">".$z[1]."</td>
            <td align=\"center\">".$z[2]."</td>
            <td align=\"center\">".$z[3]."</td>
            <td align=\"left\" width=\"300\">".$z[4]."</td>
            <td><a href=\"delete.php?id=".base64_encode($z[0])."\">delete</a></td>
            </tr>";
        }
        echo "</table>";
        }
    ?>
    
    code to delete
    
    <?php
    session_start();
    $con = mysql_connect("localhost","root","");
    mysql_select_db("uloaku", $con);
    $id = base64_decode($_GET['id']);
    if(!empty($id)){
    $sql = mysql_query("DELETE FROM transaction WHERE id='$id' LIMIT 1") or die   (mysql_error());
    }
    header("Location: vacct.php");
    ?>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Hope some one can help me out here, i created a system with more
Here's a strange one. I hope you can help. I'm trying to setup and
I hope someone can help me here. I'm having trouble loading this variable. Right
Hi hope someone can help out with this one: What I basically want is
I really hope someone here can help out with this. I'm using Magento 1.6.1.0
I have a small problem here and hope that someone can help me out.
Hope someone can help me out with this problem I am having. I just
I'm almost losing it, i really hope someone can help me out! I'm using
I hope someone can help here, we're having an incredibly annoying time with Visual
I hope someone can help, I am trying to enable enable ASP.Net Impersonation under

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.