-
How would i get something from mysql that requests something like this:
Where ID=$id and ID=SubId
I know it doesn't work, they are different tables but i would like to keep it to one wuery. How would i do this?
-
both the ID's are from different tables ? ..
i THINK you want LEFT JOIN ... not sure ... please elaborate on the exact situation
-
Never mind, I can't find an example, but when i do i will post it here.....
-
I assume you have 2 tables and they have 1 to many relation.
Person Table
id integer
name varchar(100)
...
Task Table
id integer
personId integer
task text
....
To retrieve all tasks from the person with $id;
SELECT person.name, task.text FROM person ,task WHERE person.id=task.personid AND person.id=$id
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
Bookmarks