473,770 Members | 2,065 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

selecting/using multi-table data how do you manage 'current record'?

I am working on a DB for family data, and in this application the data
spans variable amount of rows in multiple tables (one for the adults
data, one for "family", one for the kids, another for employment
schedule, and another for businesses, etc.). I was thinking on
selecting the entire family (IDs of all the related records) and
storing them in a session array for easy access (from script to
script) as I edit the data, but am wondering if there is a better way;
what other methods do any of you guys have have?

Am I correct in thinking this could be contained in a class? (I kinda
get classes but not all the way yet) And if a class is a good thing
- how is it persistent from script to script?

Aug 14 '07 #1
2 1980
la***@portcommo dore.com wrote:
I am working on a DB for family data, and in this application the data
spans variable amount of rows in multiple tables (one for the adults
data, one for "family", one for the kids, another for employment
schedule, and another for businesses, etc.). I was thinking on
selecting the entire family (IDs of all the related records) and
storing them in a session array for easy access (from script to
script) as I edit the data, but am wondering if there is a better way;
what other methods do any of you guys have have?

Am I correct in thinking this could be contained in a class? (I kinda
get classes but not all the way yet) And if a class is a good thing
- how is it persistent from script to script?
Hi,

Putting the data in $_SESSION could make sense, and it could very well not.
It depends on how big the structure (resultset) is you retrieve from the
database.
Sessiondata is saved to disk from page to page to make it persistent.
So if you session is 2 megabyte big, this will slow down your app a lot,
because of the saving and loading of such a big file.
(But also doing such a query every time on each page will probably make
your application slow.)

The bottomline is that it is hard to predict.

Personally I like to keep my sessions small, and make my queries smart.

About putting things in a class: That will not help you. Using objects
is a way of programming, not a way of optimizing your application
(speedwise, but it can increase the readability/structure of your code
of course).

My advise: Put things in a query that are really handy to have around
(such as userid, name, rights, etc) and leave the big amounts of data in
the database. A well structured database is VERY fast.

If you are unsure you can always profile the 2 approaches.
Simply store the microtime at the beginning of the script, and get it at
the end, and spit out the difference. Try this for Session-approach and
db-queries.

Remember that is the server is under heavy load, things might change a lot.

Hope that helps.

Regards,
Erwin Moller
Aug 14 '07 #2
la***@portcommo dore.com wrote:
I am working on a DB for family data, and in this application the data
spans variable amount of rows in multiple tables (one for the adults
data, one for "family", one for the kids, another for employment
schedule, and another for businesses, etc.). I was thinking on
selecting the entire family (IDs of all the related records) and
storing them in a session array for easy access (from script to
script) as I edit the data, but am wondering if there is a better way;
what other methods do any of you guys have have?

Am I correct in thinking this could be contained in a class? (I kinda
get classes but not all the way yet) And if a class is a good thing
- how is it persistent from script to script?
I agree with Erwin. If your database is properly designed, access to
your data will be fast. Much better than keeping it in the session.

Objects (instantiations of classes) are just like other variables - no
more and no less persistent.

--
=============== ===
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
js*******@attgl obal.net
=============== ===
Aug 14 '07 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

9
4648
by: Phil Powell | last post by:
I am producing a form using PHP on the back end and Javascript on the front end. The resulting script will come to the browser as follows: <script> <!-- function selectAll() { moveElement = eval("document.imageForm.move" + ""); alert(moveElement); if (document.imageForm.select_all.checked) {
0
1237
by: Mike | last post by:
I have just installed Visual Studio .NET and all necessary Windows Updates. I can open my project in the IDE without any problems and can run it without any problems. My PC's OS is Windows 2000 Professional. When I try to multi- select controls (i.e., holding down the Ctrl key on the keyboard and left-click each control with the mouse) on any of my web forms, Internet Explorer opens. I have checked all my settings and searched MSDN...
3
1957
by: debugger | last post by:
I have a drop down with alot of options say about 6000 cities and districts. I need to select all options if user selects "All checkbox". I use "on change" and a for loop to do this, but it takes a lot of time to select all these options. Is there any faster way to select all these options? function selectAll() { var element = document.getElementById("location"); var length = document.getElementById("location").length;
1
5035
by: Alvey Sidecast | last post by:
This is probably embarrassingly simple, but I've been trawling through this ng for hours now and my brain hurts. I've got an unbound multi-column listbox (multi-select=none) whose rowsource is a query based on a combobox selection. After the selection is made from the combobox the listbox may, or may not, have records in it. If it doesn't, no problems, I've got; If Me.lbxContacts.ItemsSelected.Count = 0 Then
1
3354
by: Bob Loveshade | last post by:
I am looking for an example that shows how to select and highlight multiple rows in a DataGrid. My DataGrid is part of a Web User Control which is contained in an ASPX page. I haven't been able to find any examples which demonstrate how to do this. My Code:
3
1175
by: mark | last post by:
I have a numerical array which is displayed in a datagrid by way of a datatable and a dataview. I want my user to be able to select a sub-block of the grid's cells for subsequent copy/paste/delete operations. How does one do this?
3
1806
by: Novice Computer User | last post by:
I have a drop down menu where people are able to select 1 item. However, I want to modify the drop down list so that the person can select more than 1 item (i.e by holding down the shift button and highlighting multiple items). Can somebody please let me know how to modify the php code so that they can select more than 1 item at a time?? Thanks greatly in advance. Here is the applicable .php code I believe from 2 different files: ...
8
14333
by: davihigh | last post by:
My Friends: I am using std::ofstream (as well as ifstream), I hope that when i wrote in some std::string(...) with locale, ofstream can convert to UTF-8 encoding and save file to disk. So does ifstream. Something I found shows that, I need to have a proper codecvt to set it. I need more information, maybe a small piece of code sample. Thank you!
5
3285
by: dkelly925 | last post by:
Is there a way to add an If Statement to the following code so if data in a field equals "x" it will launch one report and if it equals "y" it would open another report. Anyone know how to modify this? Private Sub cmdPreview_Click() On Error GoTo Err_Handler 'Purpose: Open the report filtered to the items selected in the list box. 'Author: Allen J Browne, 2004. http://allenbrowne.com Dim varItem As Variant 'Selected items
2
1502
by: tamashee | last post by:
Hi, I have the following set and would like to select all rows that have min value of column 4 for a given column 1 and 2 group, irrespective of column 3, as below: C1 C2 C3 C4 --------------------- A B x 5 A B y 10 A BB XX 55
0
9591
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9425
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
10228
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...
0
10057
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10002
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
8883
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
5312
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5449
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
3
2816
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.