473,396 Members | 2,021 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,396 software developers and data experts.

struggling here...with a table lookup....

Hello there,

Hope someone can help.

I have data arriving in a table, a Cron job is triggered when the data arrives.

----
table_1

id (unique)
name
message
author_id (this is the field i need to collect the data from another table)
---

One of the fields in the 'table_1' table needs to call data from the 'user' table where the data in author_id (table_1) and id (user) is an exact match...., the user table contains some of the following example fields:

----
user

id (unique) - THIS IS THE FIELD I NEED TO GET INTO THE 'author_id' field of table_1
name
age
etc
___

Looking around, I think I need to use preg_match, but am struggling

Any support/advice most welcome, I'm new to this forum :-)
Oct 23 '06 #1
2 1256
ronverdonk
4,258 Expert 4TB
One of the fields in the 'table_1' table needs to call data from the 'user' table where the data in author_id (table_1) and id (user) is an exact match....,
I don't really understand what you mean by the above, such as "needs to call data", so please explain a bit more. Do you want to match the 2 columns in the 2 tables, like
Expand|Select|Wrap|Line Numbers
  1. SELECT * FROM table_1, user WHERE author_id = id
or are you looking for a different sort of match?

Ronald :cool:
Oct 23 '06 #2
I don't really understand what you mean by the above, such as "needs to call data", so please explain a bit more. Do you want to match the 2 columns in the 2 tables, like
Expand|Select|Wrap|Line Numbers
  1. SELECT * FROM table_1, user WHERE author_id = id
or are you looking for a different sort of match?

Ronald :cool:

Hi Ronald, thanks very much for getting back to me.

I need to make a lookup and store the 'id' field in the 'user' table into the 'author_id' field within 'table_1' so the data can be associated to the user where an exact match is made.

For example: the following data exists in the User table:

---
user

id (unique) - 10202
name - Colin
age - 23
etc - likes chips
___

and a new message is submitted which arrives in a new table, and automatically triggers a cron job...

the data arrives containing the following

----
table_1

id - 002
name - colin
message - i thought the film was great that i watched tonight
author_id - ??????
---

The data is looked up to match 'Colin' in 'table_1' with 'colin' in the 'user' table and a copy of 'id' in the 'user' table is entered into the 'author_id' field in 'table 1'

In a nutshell, this is an attempt for people to be able to post without logging in, they simply enter their username and comment into a form, which then looks up and associates the newly created record to the employees record.

This is for a very small internal company system.

Thanks for any help....
Oct 24 '06 #3

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

Similar topics

1
by: Jim Stacey | last post by:
Create Lookup field with Visual Basic Can i create a lookup field on the fly? In my table Students i want to create a loookup field TeacherID that looks up teachers by their LastName. Otherwise...
7
by: Marco Simone | last post by:
Hi, What is your opinion about using Lookup field in table. I would like to use lookup field in table 1, so that I can choose data in combo box from table 2. Is this good design of database? ...
2
by: shunah | last post by:
I'm building a form that lets users manage the app's lookup tables by adding and (maybe) removing values that show up in various combo boxes across the application. The original idea was to show...
4
by: jon f kaminsky | last post by:
Hi- I've seen this problem discussed a jillion times but I cannot seem to implement any advice that makes it work. I am porting a large project from VB6 to .NET. The issue is using the combo box...
4
by: Geoff | last post by:
I need to produce a report based on a query. Cost is a calculated field and its value is dependent on another field, in the query, called Session. There are 5 different Session codes each...
6
by: mac | last post by:
Summary: 1. I want to define a column in anMS Access table to be lookups on other tables. 2. The table that is the data source (e.g the "parent" table) has a composite primary key. 3. When...
5
by: sensreview | last post by:
Hello, I need help in selecting a value from combo list thru one lookup table and update different table on MS access form. For eg; I have a lookup table of usernames, I need to use this...
5
by: Andrus | last post by:
I'm creating a database Winforms application using VCS Express 2005 I have some large lookup tables (may be up to 500000 records) which contains name and id and are stored in sql server. I...
0
by: =?Utf-8?B?RU1hbm5pbmc=?= | last post by:
(I originally posted this to the data access newsgroup but received no replies) I've got an Access 2003 mdb that I'm converting to VB.Net. I'm having trouble with getting the main data source to...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
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
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,...
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
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...
0
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,...

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.