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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T23:51:23+00:00 2026-06-13T23:51:23+00:00

I have a select box in my PHP & mysql code like. <select id=addressbook_user

  • 0

I have a select box in my PHP & mysql code like.

<select id="addressbook_user" name ="addressbook_user">
<option value="hi">hi</option>
<option value="hello">hello</option>
<option value="newa">newa</option>

<select>

I am storing the selected value in a jQuery list and i am passing that list to the php code to filter the other options except list items like.

$list = $_GET['list'];

print $list;
print_r($list);
$query = "SELECT *  from demo_addressbook WHERE user_created_id IN(SELECT id FROM demo_user WHERE user_name = '$get_user_name') AND type = 1 AND guest_name NOT IN '$list' ";                               
$sresult    = mysql_query($query) or die (mysql_error());

and based on the result i am trying to create the latest select box without selected value of the list .

but unfortunately my above query is not working

hiYou have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'hi' at line 1 is the error .

Please suggest me the best way to filter the array data from a mysql table

  • 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-13T23:51:24+00:00Added an answer on June 13, 2026 at 11:51 pm

    wrap the variable with parenthesis

    NOT IN ('$list')
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

like this is my form's select box <select name=cutid onchange=findcustid(this.value)> <option value=1001>cust 1</option> <option
I have a select box on a classic ASP page which looks like this:
I have a select box that needs to submit it's value to a server
I Have a select box, on selectinga value in it I have to display
Hello I have two dependants select box, the second one is popularited after onchange
any help would be much appreciated. I have a select/option box passing a $_GET
I have a select box that is being populated dynamically from a database. As
I have a select box on a page that does a post with jQuery
I have a select box which has more than 200 items. Below the select
I have a select box with values automatically assigned and need to convert 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.