473,387 Members | 1,606 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

PHP Data storage

Hi,

I am building an application similar to google autosuggest. I want to fetch the list of items to be suggested using PHP. Those items are stored in a database. Is it a good idea to make a database connection everytime or store them in a batch in some kind of PHP data structure. Latter seems more viable. What kind of data structure in PHP is best suited. Is it arrays or some kind of storables. I am new to PHP. Also, the no. of items will be around 5k.

Thanks.
Nov 19 '08 #1
6 2079
Dormilich
8,658 Expert Mod 8TB
for user interaction you can't use php (alone). you probably should store your items in javascript (so you don't need an ajax call every time)...

regards
Nov 19 '08 #2
for user interaction you can't use php (alone). you probably should store your items in javascript (so you don't need an ajax call every time)...

regards
Thanks for replying
I am storing it in javascript and displaying to user by formatting,CSS and all .
My worry is how do I keep those items at a backend for a faster retrieval like files,arrays, hashes etc
Nov 19 '08 #3
Dormilich
8,658 Expert Mod 8TB
when storing data in javascript, I can only think of arrays and objects as reasonable. javascript has very limited access to files (if at all) and I don't know anything about hashes and javascript. cookies are possible too, but they have to be a) enabled and b) do you want to have a 5k cookie?

what do you mean by "backend"?

regards
Nov 19 '08 #4
pbmods
5,821 Expert 4TB
Heya, rakesh19.

Look at jQuery's Autocomplete plugin, which makes use of local storage as well as Ajax (http://docs.jquery.com/Plugins/Autocomplete).
Nov 19 '08 #5
Heya, rakesh19.

Look at jQuery's Autocomplete plugin, which makes use of local storage as well as Ajax (http://docs.jquery.com/Plugins/Autocomplete).
That sounds really good Thanks for the link
Nov 19 '08 #6
when storing data in javascript, I can only think of arrays and objects as reasonable. javascript has very limited access to files (if at all) and I don't know anything about hashes and javascript. cookies are possible too, but they have to be a) enabled and b) do you want to have a 5k cookie?

what do you mean by "backend"?

regards
I have a set of 8000 items at my backend( PGSQL Database). I cannot make a DB call( I don think it as a good idea), when the user keys in something. So I was thinking of something better to speed up calls.

Thanks
Nov 19 '08 #7

Sign in to post your reply or Sign up for a free account.

Similar topics

8
by: Scott J. McCaughrin | last post by:
The following program compiles fine but elicits this message from the linker: "undefined reference to VarArray::funct" and thus fails. It seems to behave as if the static data-member:...
7
by: smith4894 | last post by:
Hello, I have a question regarding storage locations for different data types. For example, dynamically created objects (using "new") are created on the heap. local objects ( foo() {int x;} )...
4
by: Ced | last post by:
Hi, i'm not an expert in C but i try to compile BTNG software under linux kernel 2.4.2-2. I get these errors at the very first stage. Does someone could have a rapid look on this and tell me...
6
by: kobu.selva | last post by:
I was recently part of a little debate on the issue of whether constants and string literals are considered "data objects" in C. I'm more confused now than before. I was always under the...
41
by: laimis | last post by:
Hey guys, I just recently got introduced to data mappers (DTO mapper). So now I have a SqlHelper being used by DTOMapper and then business layer is using DTOMapper when it needs to persist...
8
by: Art | last post by:
Hi folks, I'm writing a traditional desktop app using VB.NET and am stumbling over what seems like a very basic question: My app does not need to be connected to a server or another computer....
4
by: Holger Marzen | last post by:
Hi all, AFAIK it is possible for columns to be very large, up to about 2 GB. Are there any hints or experiences about storing binary data (jpg-images, pdf-documents) in PostgrreSQL with or...
12
by: Chris Springer | last post by:
I'd like to get some feedback on the issue of storing data out to disk and where to store it. I've never been in a production environment in programming so you'll have to bear with me... My...
3
by: Atropo | last post by:
Hi, all. As you can see I'm just begining on C. with the tutorial "Sams Teach Yourself C in 24 Hours" as a starter. on aix 5.2 when compiling a helloWorld the gcc throws some warnings the...
10
by: Jeffrey | last post by:
My understanding is that if you write class X { int y; static int z; }; then you've defined (and declared) X and y, but you have only declared (and not defined) z. If you'd like to...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.