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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 22, 20262026-05-22T15:15:33+00:00 2026-05-22T15:15:33+00:00

I have a table in my MySQL database called studentname . I made an

  • 0

I have a table in my MySQL database called studentname.

I made an array in Javascript as var array1=["john","sam","peter","kelvin"];

I populated a select box with these array values.

If the table studentname contains names like “sam” and “peter”, now I want to populate the select box with the values “john” and “kelvin” only, because “sam” and “peter” are already present in the database table.

How am I supposed to do this?

  • 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-22T15:15:33+00:00Added an answer on May 22, 2026 at 3:15 pm

    This is a three-step process:

    1. Modify your PHP script to connect to the database and retrieve the names from the ‘studentname’ table.
    2. Output the names as a separate Javascript array.
    3. When you create your select in Javascript, compare the values of array1 to the array created by your PHP code, and output only the elements that are unique.
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a table called product_attributes in a MySQL Database. It consists of a
I have a table called products in a MySQL database. products looks some what
Ok so i have a database table called requests with this structure mysql> desc
I am calling a simple JOIN SQL on a mySQL database. The exact query
The code below echoes out an HTML table, populated with values from a MySQL
I have a quick (hopefully simple) question. I have some information stored in a
I'm using a plugin for WordPress called NGG Gallery to deal with images. I
I have this question on and of for a year or two, but it
I am trying to import various pipe delimited files using php 5.2 into a
I've been asked to add a small AJAX feature to a clients site. Basically

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.