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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T00:07:14+00:00 2026-05-31T00:07:14+00:00

I am working on a lead management system – and as the database for

  • 0

I am working on a lead management system – and as the database for it grows the need for more bulk functions appears – and unfortunately I am getting stuck with one of them. The database stores many different leads – with each lead being assigned to a specific closer; thus the database stores for each lead the lead id, name, closer name, and other info. The main lead list shows a checkbox next to each lead which submits the lead id into an array:

<input type=\"checkbox\" name=\"multipleassign[]\" value=\"$id\" />

Now this all goes to the following page:

<?php
include_once"config.php";
$id = $_POST['multipleassign'];
$id_sql = implode(",", $id);
$list = "'". implode("', '", $id) ."'";

$query = "SELECT * FROM promises WHERE id IN ($list) ";
$result = mysql_query($query);
$num = mysql_num_rows ($result);

if ($num > 0 ) {
$i=0;
while ($i < $num) {


$closer = mysql_result($result,$i,"business_name");
$businessname = mysql_result($result,$i,"closer");


echo "$closer - $businessname";
echo"<br>";

++$i; } } else { echo "The database is empty"; };



echo "<select name=\"closer\" id=\"closer\">";

$query2 = "SELECT * FROM members ";
$result2 = mysql_query($query2);
$num2 = mysql_num_rows ($result2);

if ($num2 > 0 ) {
$i2=0;
while ($i2 < $num2) {

$username = mysql_result($result2,$i2,"username");
$fullname = mysql_result($result2,$i2,"name");

echo "<option value=\"$fullname\">$fullname</option>";

++$i2; } } else { echo "The database is empty"; }
echo "</select>";

?>

I want to be able to use the form on this page to select a closer from the database – and then assign that closer to each of the leads that have been selected. Here is where I have no idea how to continue.

  • 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-31T00:07:15+00:00Added an answer on May 31, 2026 at 12:07 am

    Actually – i got it. I don’t know why I didn’t think of it sooner. First off I passed the original $list variable over to the new page – and then:

    <?php
    include_once"config.php";
    $ids = $_POST['list'];
    $closer = $_POST['closer'];
    $query = "UPDATE `promises` SET `closer` = '$closer' WHERE id IN ($ids) ";
    mysql_query($query) or die ('Error updating closers' . mysql_error());
    echo "A new closer ($closer) was assigned to the following accounts:";
    
    $query = "SELECT * FROM promises WHERE id IN ($list) ";
    $result = mysql_query($query);
    $num = mysql_num_rows ($result);
    
    if ($num > 0 ) {
    $i=0;
    while ($i < $num) {
    $businessname = mysql_result($result,$i,"business_name");
    echo "<li>$businessname";
    
    ++$i; } } else { echo "The database is empty"; };
    ?>
    

    The updated page before this:

    $query = "SELECT * FROM promises WHERE id IN ($list) ";
    $result = mysql_query($query);
    $num = mysql_num_rows ($result);
    
    if ($num > 0 ) {
    $i=0;
    while ($i < $num) {
    
    
    $closer = mysql_result($result,$i,"business_name");
    $businessname = mysql_result($result,$i,"closer");
    
    
    echo "$closer - $businessname";
    echo"<br>";
    
    ++$i; } } else { echo "The database is empty"; };
    
    
    echo "<form name=\"form1\" method=\"post\" action=\"multiple_assign2.php\">";
    echo "<input type=\"hidden\" name=\"list\" value=\"$list\" />";
    echo "<select name=\"closer\" id=\"closer\">";
    
    $query2 = "SELECT * FROM members ";
    $result2 = mysql_query($query2);
    $num2 = mysql_num_rows ($result2);
    
    if ($num2 > 0 ) {
    $i2=0;
    while ($i2 < $num2) {
    
    $username = mysql_result($result2,$i2,"username");
    $fullname = mysql_result($result2,$i2,"name");
    
    echo "<option value=\"$fullname\">$fullname</option>";
    
    ++$i2; } } else { echo "The database is empty"; }
    echo "</select>";
    echo "<input name=\"submit\" type=\"submit\" id=\"submit\" value=\"Reassign Selected Leads\">";
    
    ?> 
    

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

Sidebar

Related Questions

I'm lead dev for Bitfighter , and we're working with a mix of Lua
Working with an Oracle 9i database from an ASP.NET 2.0 (VB) application using OLEDB.
I'm working on an ERP application where multiple inventories need to be dynamically supported,
I've got OpenX working on my Flex site. But, I'm having problems getting OpenX
Our project is a content management system supporting several dozen of our websites. The
Working in F# has lead me to learn about Haskell. I'm currently on chapter
I am working on an Android app and I need to make sure that
The software I'm working with has 2 tables, lead and customer. When we sell
I'm working on a multi-user internet database-driven website with SQL Server 2008 / LinqToSQL
I'm working on an application and where I need to refer my application images

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.