473,386 Members | 1,706 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,386 software developers and data experts.

Putting together a History from 3 different database table

osward
38
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 1251
MarkoKlacar
296 Expert 100+
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
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(SELECT eid FROM cat WHERE user_id=$user_id");

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
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...
1
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...
5
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...
11
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...
3
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...
0
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...
14
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...
11
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...
23
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...
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
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
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: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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
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.