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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T06:33:42+00:00 2026-05-26T06:33:42+00:00

Hi guys I am trying to post values which is getting number from another

  • 0

Hi guys I am trying to post values which is getting number from another text box for MySQL select query but i am stuck can u please help me here is my code when I try to get result I cannot add comma(,) between values. also tried implode() and explode() function but the result only got number of array element please help me. I will be glad to try your ideas thanks.
on my sql query i get only row as a result which is my first select
thanks a lot for your help again guys

function exportselectionlist(){
var qcolumns=document.getElementById('selectionlist');
for (i=0; i < qcolumns.length; i++) {
qcolumns.options[i].selected = true;
}
document.selectionlist_form.submit();
}

<form id="selectionlist_form"  action="xxx.php" method="post"
 name="selectionlist_form">                         

    <select id="selectionlist"  style="width:300px;" multiple="multiple" size="4" 
name="selectionlist[]"> 
<option value=""></option>
<option value=""></option>
<option value=""></option>
<option value=""></option>
</select>
<input type="submit" value="x" />
<a onclick="exportselectionlist()" href="javascript:;">Export</a>
</form>

//xxx.php

    <?php   foreach ($selectionlist as $value) {

    $resultstr = array();
foreach ($selectionlist as $result)
  $resultstr[] = $result;

echo $x=implode(",",$resultstr);

sql = mysql_query("SELECT * FROM table where idArticle in ('$x')"); 
  • 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-26T06:33:43+00:00Added an answer on May 26, 2026 at 6:33 am

    Try changing your js function to:

    function exportselectionlist() {
        var qcolumns = document.getElementById('selectionlist');
        for (i=0; i < qcolumns.length; i++) {
            qcolumns.options[i].selected = true;
        }
        document.selectionlist_form.submit();
    }
    

    and then your “xxx.php” to:

        $selectionlist = $_POST['selectionlist'];
        echo implode(',', $selectionlist);
    

    As a side note, your php code indicates to me that you have register_globals turned on? I would recommend turning that off in favor of creating the variable you need from the $_POST superglobal.

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

Sidebar

Related Questions

Guys, reffering to last post I'm trying to output data while template is instantiated
Hi guys I'm trying the code samples from zend frameworks site on how to
Hey guys, I am just trying to pull all the records from my database
Hey guys, I'm trying to add a textfield.text entry to an array. I want
hey guys, this might be really stupid, but hopefully someone can help. I'm trying
HI Guys, I have following problem. I'm trying to connect from my Iphone app
Hey guys, I've been trying to upload pictures from my iPhone app to my
Hi guys I'm trying to get an automatic download box to appear when people
Hi Guys I'm trying to delete multiple events from the Google Calendar API (From
Hey guys i am trying to automate my system at work for sending artwork

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.