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

Multiple Tables Help Needed

I'm not sure the follow multiple table query is the right way to do
what I need to do although it seems to be working:

$php_SQL = "SELECT * ".
"FROM basics, personal, photos ".
"WHERE basics.member_name = personal.member_name ".
"AND basics.member_name = photos.member_name ".
"AND basics.account_creation_date >= DATE_SUB(NOW(),
INTERVAL 30 DAY)";

I primarily need to return a resultset for all member_names (they are
index key) filtered for the last 30 days on the
basics.account_creation_date - the 30 day thing is working fine.

I need to access various other table columns (fields) and display this
data on the web page - member_name is the common key for all tables -
this all seems to be working fine as I have 8 test records and can
manually track and see that it is working - the problem is that I need
to add a 4th table and in doing so, the resultset breaks and returns
just one record - I am adding an 'online' table with a col called
is_online which is set to 'yes' if the member is online but the
following query returns just the one record of the online member:

$php_SQL = "SELECT * ".
"FROM basics, personal, photos, online ".
"WHERE basics.member_name = personal.member_name ".
"AND basics.member_name = photos.member_name ".
"AND basics.member_name = online.member_name ".
"AND basics.account_creation_date >= DATE_SUB(NOW(),
INTERVAL 30 DAY)";

It seems to me this should be an easy thing to just add the 4th table
but since this breaks the query now I'm wondering if this query
structure is even built right?

Any help would be greatly appreciated...

Jul 19 '05 #1
0 1303

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: E Arredondo | last post by:
Hi, I am about migrate from an old program database to MySql (Running under RH LINUX)and I'm wondering which is the best option to do : I currently have one file for each of my modules, (I'm...
1
by: Ahmet Karaca | last post by:
Hi. myds.Reset(); mycommand.SelectCommand.CommandText= "Select att1 from Ing as Ingredient, Pro as Product "+ "where Pro.ad='apple' and Pro.id=Ing.id"; mycommand.Fill(myds, "Product"); // Here...
1
by: Justin | last post by:
What is the best/easiest way to update multiple tables at a time? Can you recommend any tutorials? Thanks, Justin.
8
by: Jason L James | last post by:
Hi all, does anyone know if I can create a dataview from multiple datatables. My dataset is constructed from four separate tables and then the relationships are added that link the tables...
5
by: mimo | last post by:
Hello, I have seen samples on how to pull data from one table and save back to it using the Form View control. How do I pull from multiple tables and save back to multiple tables on one...
6
by: ApexData | last post by:
I have 2 tables: Table1 and Table2. Neither one has a primary key because each table will only have 1-record. My form is a SingleForm unbound with tabs (my desire here). Using this form, in...
0
by: HydroPnik | last post by:
Hi all! What a great community you have here. Being an Access newbie I have already used much information gleaned from the other posters for my current project. I have been tasked with creating a...
11
TheServant
by: TheServant | last post by:
Hey guys, I am making an online game and one of the issues I have is this: Obviously I have a lot of variables per user, however probably half are needed on most pages, and then the rest are only...
0
by: shivapadma | last post by:
i want to know how multiple tables are added to the MS word document using vb.net i wrote following code to insert one table in MS word document using vb.net 1.opened MS word document 2.inserted...
6
by: nzkks | last post by:
Hi I am using these: ASP.Net 2.0 with VB.Net, Visual Studio 2005, SQL Server 2005 I suspect, there is something missing in BLL class. I created the ASP.Net form also and checked whether it is...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
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
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
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
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
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...
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,...
0
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...

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.