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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 6, 20262026-06-06T18:02:32+00:00 2026-06-06T18:02:32+00:00

Been hustling with this for a while but cant still get the page to

  • 0

Been hustling with this for a while but cant still get the page to reload after deleted a row.

The row removing is working fine, but it only appears after I reload the page.
Been moving around some of the code to get it read when pressing submit but no luck.
Any Ideas ?

 <?php
mysql_connect("localhost", "root", "") or die(mysql_error()) ; 
mysql_select_db("booking") or die(mysql_error()) ;

$resultselect = mysql_query("SELECT * FROM test_mysql ") or die(mysql_error()); 
?>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> 

<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> 

    <head> 
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /> 
        <title>row delete</title> 
        <link rel="stylesheet" type="text/css" href="" /> 
    </head> 

    <body>
<?php 
    if(isset($_POST['done'])){
    $done = implode(',', $_POST['done']);
    $deletequery = "DELETE FROM test_mysql WHERE id IN ($done)";
    $resultdelete = mysql_query($deletequery) or die(mysql_error());
    }

    ?>

    <form method="post" action="">
    <?php while($row = mysql_fetch_array($resultselect)){?>
        <input type="checkbox" name="done[]" 
    id="<?php echo $row['id'] ?>"
    value="<?php echo $row['id'] ?>">
    <label for="<?php echo $row['id'] ?>">
    <?php echo $row['name'] . ' ' . $row['lastname']. ' '.$row['email']; ?>
    </label>
    <br />
    <?php } ?>
    <input type ="submit" value ="submit">
    </form>
    <?php 

    if($resultdelete) {
        echo 'Item(s) deleted from list.';
    }
    ?>

    <pre>
    <?php print_r($_POST) ?>
     </pre>
    </body>
</html>
  • 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-06T18:02:36+00:00Added an answer on June 6, 2026 at 6:02 pm

    I’m assuming since the code you have provided is a snippet of your application code that $resultselect is set someplace before this part gets executed.

    The important part here is the order of your MySQL queries. If you are SELECTing rows before you DELETE rows, then you will still see deleted rows when you run mysql_fetch_array()

    Move the SELECT query after the DELETE query and all should be fine.

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

Sidebar

Related Questions

been trying out this for quite some time but I'm still unable to built
Been searching all around but still cannot find a solution for this problem. My
been trying to solved this for 3 days straight, but still nothing. so i
Been battling with this for a while. Seems simple enough but I seem to
Been trying to figure this out, but can't come up with a good solution
Been trying to sort this one out for a while. I'd really appreciate any
been working on this for two days now and seem to be getting nowhere.
Been working on this problem of collision detection and there appears to be 3
Been creating a time code format from decimal seconds but now need to get
Been working on a js module pattern for a while to meet the escalating

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.