| chadmaynard | so the two tables are unrelated? |
| RadarListener | The only thing linking them is the customer_id. Yes, unrelated. |
| chadmaynard | so no joins, etc. |
| vluther | but they have customer_id in common ? |
| RadarListener | Yes. No joins, nothing. |
| dennister | (yes, i'm a newb, but got mythtv with ivtv card going in 3-4 months) |
| RadarListener | Usually I'd query the two tables seperately, but this would be much easier if it was just one query. |
| chadmaynard | they should be two queries. if they are unrelated sid: I dunno what you're doing? |
| RadarListener | I dont want to have to write all that PHP code again just for another table. I would like all the information IN ONE QUERY. |
| chadmaynard | whoa dude. Don't type in caps |
| RadarListener | I know if I do SELECT * FROM `jobs`,`warranties` it gives me everything from both tables. |
| vluther | so wait.. you're getting mad at us because we aren't helping properly ? |
| RadarListener | vluther, if that's how you choose to interpret it, so be it. So how do I select everything from both tables where the customer_id is the same? |
| chadmaynard | RadarListener: you are asking for a quick trip out of here |
| zircu | RadarListener: does a job have a warranty or vise versa? |
| RadarListener | zircu, no. |
| chadmaynard | RadarListener: do they have the same number of cols? |
| vluther | select jobs.field1,jobs.field2,warranty.field2,warranty.field3 from jobs, warranties WHERE jobs.customer_id=warranty.customer_id AND jobs.customer_id=X |
| RadarListener | chadmaynard, yes. |
| sid | thanks chadmaynard, I appreciate the help. |
| RadarListener | They are identical. |
| chadmaynard | UNION SELECT * FROM t1 UNION SELECT * FROM t2; |
| zircu | RadarListener: so why the need to be done in one query? |
| RadarListener | zircu, I have a whole block of PHP code that I dont want to repeat. |
| chadmaynard | cause he WANTS IT THAT WAY! |
| RadarListener | About 70 lines. |
| chadmaynard | did you try the union? |
| RadarListener | Where does the where statement go? After it? |
| zircu | RadarListener: that doesn't make sense |
| chadmaynard | zircu: i agree |
| RadarListener | zircu, which part? |
| zircu | RadarListener: what you want is one line of sql so you dont have to do something again? |
| chadmaynard | RadarListener: yes |