Jump to content

[SOLVED] Tough MySQL query problem


guyfromfl

Recommended Posts

I have two tables - questions, and people

 

questions:

+---+-----------+-----------+

| id  | condition1 | condition2 |

+---+-----------+-----------+

|  1 |            1  |            2  |

|  2 |            4  |            3  |

|  3 |            2  |            4  |

+---+-----------+-----------+

 

 

people:

 

+----+-----------+

|  id  |  pic          |

+----+-----------+

|  1  | you        |

|  2  | me          |

|  3  | dog        |

|  4  | cat        |

+----+-----------+

 

so from a list genereated by php, i want to see what 3 is, so that would reference id 3 from table questions, then go see 2 and 4 in people. me, and cat..

 

I came up with this but it tells me questions.condition1 aren't known columns

SELECT people.pic FROM people WHERE people.id=questions.condition1 AND questions.id=3;

 

any help!? Thanks

Link to comment
https://forums.phpfreaks.com/topic/111015-solved-tough-mysql-query-problem/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.