ohitsme Posted November 24, 2008 Share Posted November 24, 2008 hi, i know when ive used ms access, i could set it up so i could do something like (i have forgotten the syntax of mssql so this is mysql language) select table1.title,table2.amount from table1 where table1.id=123 (ie, set it up so it knows what the primary and foreign keys are, and not require any join statements or where table1.id = table2.prodid) is there any way to set up things like this in mysql? thanks Quote Link to comment https://forums.phpfreaks.com/topic/133954-relationships-in-mysql/ Share on other sites More sharing options...
trq Posted November 24, 2008 Share Posted November 24, 2008 Take a look here. Quote Link to comment https://forums.phpfreaks.com/topic/133954-relationships-in-mysql/#findComment-697341 Share on other sites More sharing options...
xtopolis Posted November 24, 2008 Share Posted November 24, 2008 I think you can do: SELECT table1.title, table2.amount from table1, table2 WHERE table1.id=123 but you'd probably need a WHERE modifier for table2 as well.. I don't know.. I don't do it that way.. is there a reason you're avoiding joins? Quote Link to comment https://forums.phpfreaks.com/topic/133954-relationships-in-mysql/#findComment-697378 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.