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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 7, 20262026-06-07T22:38:09+00:00 2026-06-07T22:38:09+00:00

i have created custom query which i am sending via POST ajax but problem

  • 0

i have created custom query which i am sending via POST ajax but problem with it is that how to retrieve that data

i am sending this query = rep_id=4&filter=&filter_val=&rep_id=5&filter=&filter_val=&rep_id=6&filter=&filter_val=&from=p_employee_mst

and here is the function to fetch that query in PHP

$rep="";
foreach ($_POST["rep_id"] as $k => $v) {
    $rep[]=$v;
}
print_r($rep);

i am getting following error

Invalid argument supplied for foreach()

if print_r($_POST); i am getting this

Array
(
    [rep_id] => 6
    [filter] => 
    [filter_val] => 
    [from] => p_employee_mst
)
  • 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-07T22:38:11+00:00Added an answer on June 7, 2026 at 10:38 pm

    In your example rep_id is a simple integer value. When you put more then one parameter to your variable you get the last one. in Your case its rep_id=6.

    If you want an array then make an array in your request.

    rep_id[]=5&rep_id[]=6
    

    then you get as result:

    array (size=2)
      0 => string '5' (length=1)
      1 => string '6' (length=1)
    

    And then you can iterate over the array. Otherwise you get the following result:

    rep_id=5&rep_id=6
    
    string '6' (length=1)
    

    Because the last value / parameter win.

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

Sidebar

Related Questions

I have a similar problem with this ( https://wordpress.stackexchange.com/questions/9593/custom-post-type-archive-with-pagination ) and can't really figure
I have created custom cell in which there are n number of image views.
I have created a custom post type named People. I have created a page
I have created a custom method that will return unique items, together with the
I have created a custom control but I can't bind a property to the
I have created a custom PHP script which uploads information submitted by a form
I have created a custom post type calles articles and a custom category like
If have created a custom role within SqlServer which I added to the db__denydatareader
I have a Linq query that returns an anonymous type, which I then use
I have a custom app which uses the crmservice.asmx to retrieve contacts from dynamics

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.