Dan_Mason Posted May 5, 2010 Share Posted May 5, 2010 Hello All! I am having trouble working this one out. I am retrieving a data set from a Database which I want to look like this: Column 1 Column 2 1 NULL 2 4 3 NULL 4 5 Instead it is being returned like this: Column 1 Column 2 1 4 2 5 3 [/td] 4 [td] As you can see, this would not be a constant data set, so when being put in an matrix, wrong data is matched. Bearing in mind I am also using Dynamic Tables (Item Name, Item Value) which are constantly being updated. I have tried using a LEFT JOIN Statement, but it does not work, I am still getting incorrectly matched data back from the query. Here is the query: $result = mysql_query=( "SELECT $TableName.SectionIdent, ItemValue * 3.2808 FROM $TableName INNER JOIN $TableName2 ON $TableName.SectionIdent=$TableName2.SectionIdent WHERE $TableName.SectionIdent IN( $strNumbers ) AND ItemName = $ItemName ORDER BY StartTime" ); Any Suggestions as to a certain JOIN Type that could be used? Cheers! Dan Quote Link to comment https://forums.phpfreaks.com/topic/200840-cannot-use-left-join-in-query-db-using-dynamic-tables/ Share on other sites More sharing options...
Mchl Posted May 5, 2010 Share Posted May 5, 2010 It would help if in your example you used actual column names. Quote Link to comment https://forums.phpfreaks.com/topic/200840-cannot-use-left-join-in-query-db-using-dynamic-tables/#findComment-1053849 Share on other sites More sharing options...
Dan_Mason Posted May 5, 2010 Author Share Posted May 5, 2010 Okay, Let me re-phrase the question. Can you use an LEFT JOIN to retrieve a constant data set (As I've shown pretty clearly above) from a Dynamic Table in a MySQL Database? Thats pretty much all I want to know. Sorry for the inconvenience. Quote Link to comment https://forums.phpfreaks.com/topic/200840-cannot-use-left-join-in-query-db-using-dynamic-tables/#findComment-1053851 Share on other sites More sharing options...
Mchl Posted May 5, 2010 Share Posted May 5, 2010 Define 'constant data set' Quote Link to comment https://forums.phpfreaks.com/topic/200840-cannot-use-left-join-in-query-db-using-dynamic-tables/#findComment-1053855 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.