473,560 Members | 3,018 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 1970
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
4640
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
1227
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...
3
1949
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 =...
1
5001
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,...
1
3331
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
1159
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
1795
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?? ...
8
14281
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....
5
3249
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....
2
1494
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
7636
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...
0
8070
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...
0
6194
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...
1
5461
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...
0
3608
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...
0
3590
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2051
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
1
1171
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
882
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...

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.