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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T23:48:27+00:00 2026-05-23T23:48:27+00:00

My setup is like this: Admin search for orders depending on say address, or

  • 0

My setup is like this:

Admin search for orders depending on say address, or client name. Once all they orders are displayed for the search criteria they entered, they can select the orders using check-boxes. The code below handles that:

<form action="noJavaScript.php" name="theForm" method="post">
<table style="border: 1px solid black">
    <?php
        while ($row = mysql_fetch_assoc($result))
        {
            echo '<tr><td>';
            echo '<input type="checkbox" name="selected[]"  value="'.$row['order_number'].'"/>';
            echo '</td>';
            foreach ($row as $key => $value)
                echo '<td>'.htmlspecialchars($value).'</td>';
            echo '</tr>';
        }
    ?>
</table>
<input type="submit" name="submit" value="Edit/Modify Order" onClick="document.theForm.action='modify.php'">
<input type="submit" name="submit" value="Clone Order" onClick="document.theForm.action='clone.php'">
<input type="submit" name="submit" value="Delete Order" onClick="document.theForm.action='deleteorder.php'">
</form>

What I am trying to accomplish is depending on how many orders they select, 1, 5, 10, All of them, When they click on the Delete Order button, I want all those orders they selected to be updated in the database. I’m not sure how to do that. I have tried the following: This is the code on my deleteorder.php page:

$id = array();
$id = $_POST['selected'];

//Include database connection details
require_once('config_order.php');

//Connect to mysql server
$link = mysql_connect(DB_HOST, DB_USER, DB_PASSWORD);
if(!$link) {
    die('Failed to connect to server: ' . mysql_error());
}

//Select database
$db = mysql_select_db(DB_DATABASE);
if(!$db) {
    die("Unable to select database");
}


//Create query
$query = mysql_query("UPDATE PropertyInfo SET order_status = 'In-Active' WHERE  `order_number` LIKE $id[0]");

That doesn’t work, as it only updates the value assigned to $id[0] and not all of the orders they might have selected.

Any help would be greatly appreciated! 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-23T23:48:27+00:00Added an answer on May 23, 2026 at 11:48 pm

    I’m assuming the $id is an array of all the id’s selected:

    $query  = "UPDATE PropertyInfo SET order_status = 'In-Active' WHERE ";
    $query .= "`order_number` IN (".implode(',', $id).") ";
    $results = mysql_query($query);
    

    Using implode to comma separate the array values

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

Sidebar

Related Questions

I have a ToggleButtonBar with a DataProvider setup like this: <mx:ToggleButtonBar itemClick=clickHandler(event); selectedIndex=0> <mx:dataProvider>
Our VSS setup is like this: We have a set of unique folders with
I would like to setup a admin page (ASP.NET/C#) that can add IIS host
I have a table named sessions setup like this: ################################# # set # timestamp
If I have a folder structure set up like this: ~/Projects emacs package1 package1-helpers
I have a ComboBox that I set up like this: this.cmbCustomerJob.DisplayMember = display; this.cmbCustomerJob.AutoCompleteMode
I currently have my PHP class variables set up like this: class someThing {
I have a regular .NET Windows Forms treeview control. The nodes are setup like
I'd like to setup a WCF service to send emails. The System.Net.MailMessage doesn't seem
I'd like to setup Tomcat on Windows and have authentication in my web application

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.