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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 7, 20262026-06-07T07:19:25+00:00 2026-06-07T07:19:25+00:00

I’m here today because i’m under a minor issue that i can’t seem to

  • 0

I’m here today because i’m under a minor issue that i can’t seem to solve and it’s why it brings be here.
The issue is that i’m trying to get multiple ID’s from a $_GET variable to print out. I tried to use array and great, it works but the thing is it makes separate arrays with [0] and i need it to be as one in the same array not array() array() which is what its doing.

So i’m using while() with mysql_fetch_array to get the results off the database and it depends on the $_GET from the url in-order to grab the correct id’s. So in the URL i pass in api.php?do=remove&id=1,4,7 it will only print out the first id and not the others as a name. As i said i tried with array() and this is what came out :

Array
(
    [0] => BzlXO.jpg
)
Array
(
    [0] => cHZTk.jpg
)
Array
(
    [0] => 9yset.jpg
)
Array
(
    [0] => Ss04V.jpg
)

i don’t understand why its doing that as i need it to be in one array as in

Array (

   [0] => BzlXO.jpg,
   [1] => cHZTk.jpg,
   [2] => 9yset.jpg,
   [3] => Ss04V.jpg
)

So that way when i implode them it will show as text as in:
“You removed image(s) “BzlXO.jpg,cHZTk.jpg,9yset.jpg,Ss04V.jpg”
with something like

        $iName[imagename] = array($iName[imagename]);
        $name = implode(",", $iName[imagename]);

Here is my code:

This is the URL “api.php?do=remove&id=1,4,7”

      $ID = $_GET['id'];
    $query = "SELECT ID,imagename FROM uploads WHERE ID IN ({$ID}) AND username = '{$uploader}'";
    $result = mysql_query($query);

      while( $iName = mysql_fetch_array($result)){
          $querys = "DELETE FROM uploads WHERE ID IN ({$ID}) AND username = '{$uploader}'";
      $results = mysql_query($querys);

          if(!$results) {
       $api_message = 'Failed to get a Removal result';
       } else {

            $iName[imagename] = array($iName[imagename]);
            $name = implode(",", $iName[imagename]);

           $api_message = "You removed image(s) $name"; 

          }
}

The OUTPUT :

You removed image(s) BzlXO.jpg

but i need it to be:

The OUTPUT :
You removed image(s) “BzlXO.jpg,cHZTk.jpg,9yset.jpg,Ss04V.jpg”

Any help with this will be much appreciated, if any more information is needed please let me know and i’ll include
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-06-07T07:19:27+00:00Added an answer on June 7, 2026 at 7:19 am

    In addition to the solution posted by raina77ow, there is also a problem with the control flow in that you are executing the DELETE FROM uploads WHERE ID IN (...) statement for each iteration of the while loop. This will delete all the records on the first iteration. You need to change it to something like:

    $ID = $_GET['id'];
    $names = array();
    $query = "SELECT ID,imagename FROM uploads WHERE ID IN ({$ID}) AND username = '{$uploader}'";
    $result = mysql_query($query);
    
      while( $iName = mysql_fetch_array($result)){
          $querys = "DELETE FROM uploads WHERE ID = {$iName['ID']} AND username = '{$uploader}'";
          $results = mysql_query($querys);
          if(!$results) {
           $api_message = 'Failed to get a Removal result';
          } else {
            $names[] = $iName['imagename']);
          }
      }
      $name = implode(",", $names);
      $api_message = "You removed image(s) $name"; 
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm parsing an RSS feed that has an ’ in it. SimpleXML turns this
I'm trying to decode HTML entries from here NYTimes.com and I cannot figure out
I'm trying to create an if statement in PHP that prevents a single post
That's pretty much it. I'm using Nokogiri to scrape a web page what has
Basically, what I'm trying to create is a page of div tags, each has
I have a jquery bug and I've been looking for hours now, I can't
link Im having trouble converting the html entites into html characters, (&# 8217;) i
I am trying to understand how to use SyndicationItem to display feed which is
I have a string like this: La Torre Eiffel paragonata all’Everest What PHP function
I've got a string that has curly quotes in it. I'd like to replace

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.