473,587 Members | 2,509 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

PHP MySQL Query

8 New Member
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 1319
Chrisjc
375 Contributor
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
FallingReign
8 New Member
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
simonhuntley
6 New Member
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,ass ociates_table WHERE sales_table.id= associates_tabl e.id
Mar 8 '07 #4

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

Similar topics

0
3938
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 version of this document can be found at: http://prdownloads.sourceforge.net/souptonuts/README_mysql.txt?download
1
3366
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 uses his own php shopping cart to receive customer orders. The configuration was done via cPanel with no external modifications - which produced no protests when built, ran and connected with no
1
15375
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, lastname, from associates where username like 'nancianne' but now fails with: "You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'from associates
3
8479
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 the function load_image is called. Would anyone be able to point me to what I might be doing wrong? Thanks in advance, C Newbie
0
7852
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
8349
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...
1
7974
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8221
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
6629
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
5719
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
3845
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 the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
2364
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
1455
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.