Help with a simple database lookup

Posted on 2006-06-01
Medium Priority
Last Modified: 2010-04-09
Hi - I have a fairly simple database of two sets of numbers - group and ID.  I need to make a webpage that the user would enter the group number and it would show the applicable IDs associated with the group.  The database is currently in Excel, but it can be exported to anything.  I don't know SQL so I am not sure if this is possible in just HTML.  Thanks for the help.   == Rob ==
Question by:Robincog
LVL 17

Expert Comment

ID: 16810505
What is the back end technology?
AJAX can be a solution for you. But all depends on your approach

Author Comment

ID: 16810686
Like using an get command in XML?

Anyway - linux box server, Java2SDK only no servlets, standard stuff as well perl, C, PHP4 - all could be solutions if needed, but I was also wondering if there was a much more simple, though less elegant HTML solution?

                == Rob ==
LVL 30

Expert Comment

ID: 16810812
If there is not too much data, you can use a flat text file to store your data.
Then use php to read the file and only return the data that has been asked.
XML will be much heavyer.

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.


Author Comment

ID: 16810893
There is a minimum of 3,000 records (1,500 of each), and a max of 22,000 (11,000 of each) but the first column is only six digits and the second is eight.  I could sub-divide the records into major groups 1-2, 3-4, 5-6, etc if that makes it into a managable size for the lookup.
LVL 30

Accepted Solution

GrandSchtroumpf earned 252 total points
ID: 16811139
You should definitely not load the entire file into memory.
Just read some bytes at a time.
This is is an example that echoes a file:

  function echoFile($filename) {

    $myhandle = fopen($filename, 'r');
    while($mybuffer = fread($myhandle, 512)) {
      echo $mybuffer;


512 is the number of bytes read, so if your records are fixed byte-size, that's easy to do:
Just add a test in the while loop, adjust the size of the buffer and you are done!
...but a slight corruption in the file and it won't work anymore.
You'll need to do some benchmarking, but i think it's a workable solution.
LVL 10

Assisted Solution

ClickCentric earned 248 total points
ID: 16811601
There is a simple but less elegant solution in just html.  Create a select box with all of the records as name/value pairs.  Then the user can just select the record number from a list.  Or, if a type in and lookup solution is preferred, a simple javascript call could do this.  However, be warned that this could be quite a slow page load.

Featured Post

Upgrade your Question Security!

Add Premium security features to your question to ensure its privacy or anonymity. Learn more about your ability to control Question Security today.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Building a website can seem like a daunting task to the uninitiated but it really only requires knowledge of two basic languages: HTML and CSS.
Find out what you should include to make the best professional email signature for your organization.
In this tutorial viewers will learn how to style a corner ribbon overlay for an image using CSS Create a new class by typing ".Ribbon":  Define the class' "display:" as "inline-block": Define its "position:" as "relative": Define its "overflow:" as …
The viewer will learn how to create a basic form using some HTML5 and PHP for later processing. Set up your basic HTML file. Open your form tag and set the method and action attributes.: (CODE) Set up your first few inputs one for the name and …
Suggested Courses

850 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question