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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T18:22:54+00:00 2026-06-01T18:22:54+00:00

// Show the members that are in the Database $query = SELECT user_id, membership_id,

  • 0
    // Show the members that are in the Database
    $query = "SELECT user_id, membership_id, user_email, first_name, last_name, approved        FROM vintage_user ORDER BY user_id ";
$result = mysql_query( $query, $mysql )
or die( mysql_error() );

if (mysql_num_rows($result) > 0){
$members = "<ul class='theApprovalList'>";
while($ev = mysql_fetch_array($result)){
    $row_id = $ev['user_id'];
    $first_name = $ev["first_name"];
    $last_name = $ev["last_name"];
    $email_member = $ev["user_email"];
    $membership_id = $ev["membership_id"];
    $members .= "<li><p>Members Name: ".$first_name." ".$last_name."</p></br>    <p>Member's Email: ".$email_member."</p></br><p>Membership ID: ".$membership_id."</p></li>";
    $members .= "<li><form action=".$myPage."  method=\"post\"><input class=\"event_item_box\"  id=".$row_id." type=\"checkbox\"  name=members_cbox[] value=".$row_id."></li><p  class=\"event_item_border\"><p/>";


if (sizeof($_POST['members_cbox'])) {
foreach($_POST['members_cbox'] AS $row_id ) { 
                $email_query_member = "SELECT user_email FROM `vintage_user` WHERE user_id='" .$row_id. "'";
            $the_result_member = mysql_query( $email_query_member, $mysql )
                or die( mysql_error() );
            if (mysql_num_rows($the_result_member)){
                $email_list_member = "";
                while($ev5 = mysql_fetch_array($the_result_member)){
                    $user_emails_member = $ev5["user_email"];
                    $email_list_member .= "".$user_emails_member.",";
                }
                mysql_free_result($the_result_member);
            }
        $to2 = $email_list_member;
        $from = "";
        $subject2 ="";
        $headers = "From: {$from}" . "\r\n";
        $headers .= 'Content-type: text/html; charset=iso-8859-1' . "\r\n";
        mail($to2, $from, $subject2, $headers);
        mysql_query("DELETE FROM `vintage_user` WHERE user_id='" .$row_id. "'");

That is what im using right now and it sends an amount of emails based on how many users are in the list but only to the users being deleted, its a very weird bug. maybe I should use a limit or actually grab the amount of users being targeted? Thanks in advance.

  • 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-01T18:22:55+00:00Added an answer on June 1, 2026 at 6:22 pm

    Looks like your problem (other than the fact this code could use a major refactor) is in the while loop:

    while($ev5 = mysql_fetch_array($the_result_member)){
        $user_emails_member = $ev5["user_email"];
        $email_list_member .= "".$user_emails_member.","; // Problem
    }
    

    The email_list_member is being appended to for every user found in foreach loop. Try just assigning the value rather than appending it.

    — Update —

    Ugh, didn’t want to get into a refactor, but try this (untested):

    if (sizeof($_POST['members_cbox'])) {
    
        $membersToDelete = $_POST['members_cbox'];
    
        // If this doesn't work
        $membersToDelete = array_map('mysql_real_escape_string', $membersToDelete);
    
        // Use this
        $membersToDelete = array_map('intval', $membersToDelete);
    
        $email_query_member = "SELECT user_email FROM `vintage_user` WHERE user_id IN (" . implode(',' $membersToDelete) . ")";
    
        $the_result_member = mysql_query( $email_query_member, $mysql ) or die( mysql_error() );
    
        while($ev5 = mysql_fetch_array($the_result_member)) {
    
            $user_emails_member = $ev5["user_email"];           
    
            $to2 = $user_emails_member;
            $from = "";
            $subject2 ="";
            $headers = "From: {$from}" . "\r\n";
            $headers .= 'Content-type: text/html; charset=iso-8859-1' . "\r\n";
            mail($to2, $from, $subject2, $headers);
        }
    
        mysql_query("DELETE FROM `vintage_user` WHERE user_id IN (" . implode(',' $membersToDelete) . ")";
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

My problem is i want to show emailids of users who are currently members
I have 2 database tables that looks like this Subscriptions table member_id active 5
I have a login function that authorizes against a remote database over xml webservice.
I am making a member's management database. I want to put all the members
I have the following code that downloads an object from a 3rd party and
I have staff members that are assigned tasks, I need to find the percentage
I am working on a web site that lets members sign up for classes...
I have a query that joins to a Counties table. That table contains 14
I got trouble on Member Description show up. For example, I have two laptops.
Imagine I have a class Window with a member function show which causes the

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.