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

  • Home
  • SEARCH
  • 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 8784809
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T21:11:50+00:00 2026-06-13T21:11:50+00:00

any help would be much appreciated. I have a select/option box passing a $_GET

  • 0

any help would be much appreciated.

I have a select/option box passing a $_GET array into a php controller that passes this value into a model retrieving some MySQL.

However I am up to the stage where I am just wishfully stabbing at this now. I think the problem is with the array though.

<select id="frm_type" style="margin-left:180px; width: 136px; height:100%;" name="uid[]" multiple="multiple">
    <option value="U4BC3128209B01">All Users</option>
    <option value="U4D88B8CFE7579">more options</option>        
</select>

The $_GET looks like this ?&uid%5B%5D=U4DFF15A4581A4&uid%5B%5D=U4D88B8CFE7579
This comes into the controller like so…

$filter_in = $_GET;

then is called into the model like this.

$body_data['user_stats'] = $this->mtvm_model->user_stats($filter_in);

Then finally the relevant section that wants to use it does this:

        if ($filter_in['uid'] != '')
        {
        $sqlQuery .= " AND ";

        foreach($filter_in['uid'] as $key=>$value)
            {
            $sqlQuery .= " ".$this->tables_calls.".userId = '".mysql_real_escape_string($value)."' ";
            if($key != count($filter_in['uid'])-1) 
                {
                $sqlQuery .= " OR ";
                }
            }
        }

Is it simply that I am incorrectly trying to pass an array as $filter_in['uid']?

  • 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-13T21:11:52+00:00Added an answer on June 13, 2026 at 9:11 pm

    The query string:

    uid%5B%5D=U4DFF15A4581A4&uid%5B%5D=U4D88B8CFE7579
    

    implies that $_GET["uid"] looks like this:

    Array
    (
        [0] => U4BC3128209B01
        [1] => U4D88B8CFE7579
    )
    

    Your should check for the presence of this variable like this:

    if (isset($filter_in['uid']) && is_array($filter_in['uid'])) {
        // ...
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm quite new to php and jquery so any help would be much appreciated.
I am stuck here, any help would be appreciated. I have a listbox of
I am new to jQuery. Any help would be appreciated I have two radio
Any help here would be greatly appreciated. I have this table hospital Nurse |
I'm really struggling to get this working so any help would be much appreciated!
Would very much appreciate any help or hint on were to go next. I'm
Any help would be appreciated, I'm trying to convert the code below to C#,
Any help would be appreciated. I am looking for a way to programatically notified
I am relatively new to db design, so any help here would be appreciated.
am trying to squeeze some performance out of this query, any help would be

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.