coder9 Posted July 29, 2008 Share Posted July 29, 2008 i want to select a table where is currently joined (has foreign key). is this possible? or do i need to join select both the tables first? before i can get the value of a field inside a table joined? thank you. Quote Link to comment Share on other sites More sharing options...
coder9 Posted July 29, 2008 Author Share Posted July 29, 2008 i just want to select one table (where is currently has foreign key). is this possible? Quote Link to comment Share on other sites More sharing options...
realjumper Posted July 29, 2008 Share Posted July 29, 2008 For goodness sake......put this thread back in the php forum. Quote Link to comment Share on other sites More sharing options...
pocobueno1388 Posted July 29, 2008 Share Posted July 29, 2008 For goodness sake......put this thread back in the php forum. Why put it in the PHP forum when it's clearly a MySQL issue? i want to select a table where is currently joined (has foreign key). Can you give us the table structures, and tell us exactly what your trying to select? It sounds like you can do it with one query using a join. Quote Link to comment Share on other sites More sharing options...
realjumper Posted July 29, 2008 Share Posted July 29, 2008 Why put it in the PHP forum when it's clearly a MySQL issue? . 1. Because I'll lay odds that the query isa going to be written in PHP.....for use in a PHP application. 2. Because there is no one watching this forum most of the time, compared to many watch the PHP forum most of the time. 3. Because it's silly to split hairs.....it's not as if it's a JavaScript question!! Quote Link to comment Share on other sites More sharing options...
.josh Posted July 29, 2008 Share Posted July 29, 2008 1. The problem is strictly MySQL. There is no actual PHP coding help needed 2. That's your real problem right there, not that it's in a different forum, but that it's in a lower volume forum 3. Now that's just being kind of hypocritical, don't you think? I can just see someone in the JS forum bitching about his topic being moved, saying ..."it's not as if it's a MySQL question!!" Quote Link to comment Share on other sites More sharing options...
realjumper Posted July 29, 2008 Share Posted July 29, 2008 Hypocritical? I don't see how. I was trying to illustrate that if the question was about JavaScript (for example), then moving the thread to the Javascript forum would be a good thing. As for point 1, lets ask the poster whether he/she is going to use this query in a php script or not. Quote Link to comment Share on other sites More sharing options...
pocobueno1388 Posted July 29, 2008 Share Posted July 29, 2008 As for point 1, lets ask the poster whether he/she is going to use this query in a php script or not. There question is about the QUERY, which is 100% MySQL. If they were asking a question about how to use the query with PHP, then maybe the topic would have been fine in the PHP forum...but they aren't. Quote Link to comment Share on other sites More sharing options...
realjumper Posted July 29, 2008 Share Posted July 29, 2008 You're splitting hairs...where do *you* think the query is going to be used? Quote Link to comment Share on other sites More sharing options...
.josh Posted July 29, 2008 Share Posted July 29, 2008 It doesn't matter where it's being used. The poster isn't asking for help on what to do with the query results. He's asking about the query itself. Quote Link to comment Share on other sites More sharing options...
coder9 Posted July 29, 2008 Author Share Posted July 29, 2008 ok guys I have these existing tables let say table a, table b and table c. (all connected, meaning they are joined using foreign key) note: that these table structure is not my work. (this is the work of another programmer) now i just want to select table a. I'm currently selecting table a only. but there is no result and no error. i'm not sure if this is possible. since i haven't experienced this before. any nice advice? Thank you. Quote Link to comment Share on other sites More sharing options...
corbin Posted July 29, 2008 Share Posted July 29, 2008 So, errr.... Can you give us columns? All of this vagueness annoys me. So you want the data from a, but you want to join b and c with a before selecting the stuff? So, basically you have something like: table a: col1 | col2 table b: col1 | col2 table c: col1 | col2 Let's say col1 is the ID (and foreign keys)... You want to select everything from a based on col2 from b or c or something? Maybe I need to reread everything, but at the moment, I have no idea what you're trying to do. Quote Link to comment Share on other sites More sharing options...
coder9 Posted July 29, 2008 Author Share Posted July 29, 2008 no the table a b c are already connected (with foreign key). i just want to select only table a. or get the data value from table a. i tried it but i don't see any results and no error. mmm. i wonder why... Quote Link to comment Share on other sites More sharing options...
fenway Posted July 31, 2008 Share Posted July 31, 2008 I have no idea what you're talking about. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.