Click to See Complete Forum and Search --> : JavaScript Search Question AJAX


starfusionmz
04-23-2007, 07:40 AM
OK right now I have a search that does a query everytime I press a key. I was curious if I could make it do one query on like page load to populate an array and then search that array on display the results on every key up instead of searching by quering the mysql database everttime.

ricp
04-23-2007, 07:45 AM
Is this a question, or are you just musing? This all depends on the amount of data you have.

starfusionmz
04-23-2007, 08:52 AM
a question. The data would be about 1000 rows in a mysql table maximum but about 50-100 rows right now. but each row its pretty small only user information and such.

starfusionmz
04-23-2007, 08:31 PM
so is it possible? also I would like to add that it would only need the two of the fields in the row so about 60 bytes for each row

konithomimo
04-23-2007, 09:03 PM
so is it possible? also I would like to add that it would only need the two of the fields in the row so about 60 bytes for each row
What you are inquiring about is possible, but is not recommended, since that allows for memory and data leaks, which makes a site very unsecure . As ricp said, it all depends on how much data you wish to work over, and a large table will most likely cause problems. It would be faster to just do a DB inquiry each time. Of course, that means more work done by your server, instead of the user's browser.