473,813 Members | 2,477 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Putting together a History from 3 different database table

osward
38 New Member
Hello everyone,

Background:
cat table - holds the event details and has a unique "eid" field
user and user_temp table has the "eid" "user_id" and other fields, they are almost identical, the only difference is when user confirm the registeration of the event, it moves from user_temp to user

What I want to do is return a history telling the user all the events he had joined including confirm and not confirm

The return table would get data from the cat table showing the particuars of the events plus a colum tell the user that event he had confirmed or not

I know how to query for "eid" from user and user_temp,
my question is how am I going to pull out the data from the cat table by using the "eid" I got from both tables. I assume each would return an array of "eid" because user might join more than one event.

I think this is a many to one query that I have no idea how to accomplish
Please tell me how I could query the cat table and pull out the rows.

Thanks in advance
Oct 25 '07 #1
2 1272
MarkoKlacar
296 Recognized Expert Contributor
Hey Osward,

sounds to me you need to look at some SQL joining, try looking at this tutorial and let me know how it went.

Cheers
Oct 26 '07 #2
osward
38 New Member
Hey Osward,

sounds to me you need to look at some SQL joining, try looking at this tutorial and let me know how it went.

Cheers
Hi MarkoKlacar

Thanks for the link and it's really resourceful. I think I need time to read it all through because I only understand a little bit html and php

I think I better rephase my orginal question to let everybody understand what I am trying to achieve and hopefully give me a kick start. I will certainly read through all the sql command.

First let me list the command field of the three tables in question

Expand|Select|Wrap|Line Numbers
  1. table          field1      field2     field3
  2. cat             eid
  3. user            eid        user_id    username
  4. user_temp       eid        user_id    username
First, I will query user and user_temp for eid result
$result = $db->sql_query(SELE CT eid FROM cat WHERE user_id=$user_i d");

Then, I want to pass the return eid and query the cat table. Put result of the corresponding eid content in a html table

I am not sure how to use the result of the First step (eid) and query the cat table to return the data I need and put it in the html table.

Please give me a kick start if you could
Thanks in advance
Oct 26 '07 #3

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

Similar topics

2
2508
by: Nicki Pittman | last post by:
I have a web-based application that contains page with a form to allow a user to edit their account information (i.e. address, phone, email, etc.). This form is being pre-populated through XSLT from my database. This form submits to a second form/page that uses XSLT to compare the original values in my database to the parameters submitted by the previous for to filter out which values have changed. This second form will ask the user to...
1
1589
by: Gomez | last post by:
I have set up two tables ****current and ****history. The history table contains all the fields which I want to track changes on. The current table contains just the most recent information from those fields (history not important). The entry forms are set up with a query to access each field from it's correct table. I have a 2 field primary key in the history table (field 1 is a facility ID, and field 2 is the date of inspection). ...
5
2705
by: Raphael Bauduin | last post by:
Hi, I'm looking at the logging of a database we'll put in production soon. I've seen some posts on this list about history tables, like mentioned in http://www-106.ibm.com/developerworks/web/library/wa-dbdsgn2.html . I think I'll go that way too, but I still have some questions on the approach, and would appreciate any advice on it. Here are some questions I have: - is it possible to write only one function used for all logging...
11
1709
by: J.Evans.1970 | last post by:
Hello. I've got a table I'm trying to tie to two other tables. The problem is that there is nothing distinct between the 3 tables. Yes, I know... But this is what I have to work with. Let me explain exactly what it is I'm trying to do with a little background history. First, the fast food company I work for has registers in their stores. We capture TLD files from the registers every 15 minutes. On a daily basis those files are...
3
2644
by: Rafael Tejera | last post by:
I would like to create an history module to my application.. I need some advice to use a duplicate database with who, when and where fields added to that new duplicate table, or create a table with a character field saying which fields have been affected and others fields with who, when and where. What is the best way to keep an historical table of other table? Any example or article that I can read. Sincerely,
0
1431
by: ummaria | last post by:
Hello, I have posted a question related to this problem before but I never got the full understanding of the concept. I would really appreciate if someone could help me, my deadline for the design of the project is in 2 days and I'm still having doubts :( The system I'm developing is a VB/ASP.NET web application connected to a MS SQL Server Express. The requirement is to be able to view a report that shows actions performed on all the...
14
1820
by: Megi | last post by:
Helo, I found at forum somebodys post: I'm trying to parse an input file and then take data from that file and enter it into a MySQL database. I'm separating the fields with tabs '\t' and ending the records with a newline '\n'. I'm using the LOAD DATA function (see the code snippet below). # Load the data into the history table my $sql_statmnt2 = "LOAD DATA LOCAL INFILE \'$history_file\' INTO TABLE History"; print "$sql_statmnt2 \n";...
11
2384
by: unionhorse | last post by:
Hello, We use an access database for the membership administration of thousands of musicians. Membership status varies from "active" to "suspended" to "expelled". Musicians go in and out of active membership. The database keeps track of the last time a member was suspended and the last time a member was expelled. Unfortunately, like many programs, the history is written over each time. My goal is to automate capturing a "30-years...
23
2220
by: swali | last post by:
I have a History table which is connected to the Admission table and the Admission table is connected to the Patient Information table. You can have multiple Admissions for one patient. I want to be able to copy the record in the History table to the next admission. Since the History of the Patient doesn't change much from one admission to the other. I want each Admission ID to have a different History ID. Hope that makes sense . Thank you.
0
9734
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
9607
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
10667
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
10407
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...
0
9222
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...
1
7681
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
6897
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();...
1
4358
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
3030
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.