473,786 Members | 2,462 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

PHP Data storage

17 New Member
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 2100
Dormilich
8,658 Recognized Expert Moderator Expert
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
rakesh19
17 New Member
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 Recognized Expert Moderator Expert
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 Recognized Expert Expert
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
rakesh19
17 New Member
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
rakesh19
17 New Member
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
4592
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: VarArray::funct were an extern, but it is declared in the same file (q.v.). What is the remedy for this? =================
7
2474
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;} ) are on the stack. 1)Where are global non-const objects created? 2)Where are global const objects created?
4
25553
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 what's wrong regards I get this error:
6
2022
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 understanding that only "named" storage areas(from the standard) were data objects. Since constants and string literals don't have lvalues, they can't be data objects. Yet, I was shown the first page of chapter 2 in K&R2, which states that variables...
41
4736
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 object to database or load them back. Everything is working nicely so far. My question is, is it OK practice to use DTOMapper rfom the presentation layer? For instance, if I want to present in HTML format the list of entries in my database, should I...
8
3773
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. It just runs locally. So what is the best way to store user-entered data? The app is like an address book, where users can enter contacts and save the data.
4
4041
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 without the complicated lo-stuff? Of course it's in many cases a good approach to store those files simply in the file system but there's always a risk of running out of sync (filesystem and tables), e.g. by deleting files and not deleting the table...
12
3767
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 question is about storing data in a database. Yes I understand that you can link to a database in your program and read and write to the database etc etc. Well, that's all find and dandy but what if the person you're writing the application for...
3
1907
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 system adminitrator does'nt know anything about. could you point me where to check the gcc conf. or what i'm doing wrong Atropo@seagullmore captura.c #include <stdio.h>
10
2529
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 actually define z, you also need to add
0
9496
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10363
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
10110
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9961
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
7512
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6745
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5534
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4066
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
3
2894
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.