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

PHP MySQL Query

Hi i was wondering if anyone could help me to get information from 2 different tables in my database...

Associates (table)
-ID
-email

Sales (table)
-ID
-payment

What I need to do is have the above information displayed in a table like the one below. both ID's in the tables sales and associates are identical.

Expand|Select|Wrap|Line Numbers
  1. Email               |  Payments  |  ID  |
  2. email1@mail com     |   $100.00  | ID01 |
  3. email2@mail.com     |    $45.00  | ID02 |
  4.  
FallingReign
Mar 8 '07 #1
3 1299
Chrisjc
375 256MB
Hi i was wondering if anyone could help me to get information from 2 different tables in my database...

Associates (table)
-ID
-email

Sales (table)
-ID
-payment

What I need to do is have the above information displayed in a table like the one below. both ID's in the tables sales and associates are identical.

Expand|Select|Wrap|Line Numbers
  1. Email               |  Payments  |  ID  |
  2. email1@mail com     |   $100.00  | ID01 |
  3. email2@mail.com     |    $45.00  | ID02 |
  4.  
FallingReign

Why two tables? why not

ID
email
payment

in one table? Just wondering..
Mar 8 '07 #2
Why two tables? why not

ID
email
payment

in one table? Just wondering..
There is alot more information than just those values and it would require me to rewrite alot of the website to have the email field in the Sales table.

I was just hopeing that there was some code that i could use instead to retrieve them both.
Mar 8 '07 #3
Hi i was wondering if anyone could help me to get information from 2 different tables in my database...

Associates (table)
-ID
-email

Sales (table)
-ID
-payment

What I need to do is have the above information displayed in a table like the one below. both ID's in the tables sales and associates are identical.

Expand|Select|Wrap|Line Numbers
  1. Email               |  Payments  |  ID  |
  2. email1@mail com     |   $100.00  | ID01 |
  3. email2@mail.com     |    $45.00  | ID02 |
  4.  
FallingReign
SELECT * FROM sales_table,associates_table WHERE sales_table.id=associates_table.id
Mar 8 '07 #4

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

Similar topics

0
by: Mike Chirico | last post by:
Interesting Things to Know about MySQL Mike Chirico (mchirico@users.sourceforge.net) Copyright (GPU Free Documentation License) 2004 Last Updated: Mon Jun 7 10:37:28 EDT 2004 The latest...
1
by: jlee | last post by:
I'm pretty much a newbie on mysql, and I need some help. I am running mysql Ver 12.22 Distrib 4.0.24, for portbld-freebsd5.4 (i386) on a server hosting an active website. The site's developer...
1
by: Ike | last post by:
Recently, I began using a different MySQL verver (i.e. different machine as well as different version#, going from 4.12a to 4.1.9 max). The following query used to work: select firstname,...
3
by: Me Alone | last post by:
Hello: I am trying to edit some C code I found in "The definitive guide to using, programming, and administering MySQL" by Paul DuBois. This C client program connects and then segfaults when...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 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 former...

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.