FooKelvin Posted November 5, 2015 Author Share Posted November 5, 2015 But the problem is, when I hard code the query with WHERE FiscalYear ='FY16' The table will only show the course name, if there is an event happen in FY16. Meaning it will not show the full list of courses. =( Quote Link to comment Share on other sites More sharing options...
Barand Posted November 5, 2015 Share Posted November 5, 2015 Don't put FiscalYear condition in the WHERE clause, put it in the table join condition LEFT JOIN eventtbl e ON c.cid = e.cid AND e.FiscalYear = 'FY16' Quote Link to comment Share on other sites More sharing options...
FooKelvin Posted November 6, 2015 Author Share Posted November 6, 2015 oh.. it use me few hours to figure out. Thanks Barand! Quote Link to comment Share on other sites More sharing options...
FooKelvin Posted November 13, 2015 Author Share Posted November 13, 2015 Hi Barand, Â Sorry for disturbing you. Â I put in end date to make the table more details. but the layout seem to be incorrect. The attachment included 2 start date end 2 end date, but they are like combine it together. Â Â 11/03/15-11/04/15 Â <- is a complete start and end 11/23/15-11/24/15Â Â <- is a complete start and end Quote Link to comment Share on other sites More sharing options...
Barand Posted November 13, 2015 Share Posted November 13, 2015 (edited) try applying this to your "td" css white-space: nowrap; Edited November 13, 2015 by Barand Quote Link to comment Share on other sites More sharing options...
FooKelvin Posted November 14, 2015 Author Share Posted November 14, 2015 after i add the css, the date like merging together. Â Â Â Quote Link to comment Share on other sites More sharing options...
Barand Posted November 14, 2015 Share Posted November 14, 2015 Then you're doing it incorrectly. Â Post current code. Quote Link to comment Share on other sites More sharing options...
FooKelvin Posted November 14, 2015 Author Share Posted November 14, 2015 I added a line end date after the start date. if ($sd){ $data[$cid]['events'][$m][] = date_format(($sd), 'm/d/y'); //m/d/y } if ($ed){ $data[$cid]['events'][$m][] = date_format(($ed), 'm/d/y'); //m/d/y } Quote Link to comment Share on other sites More sharing options...
Barand Posted November 14, 2015 Share Posted November 14, 2015 You are adding each date as a separate item. You need to add the date pairs as one item then join the items using "<br>" if ($sd){ $item = date_format(($sd), 'm/d/y'); //m/d/y } if ($ed){ $item .= '-' . date_format(($ed), 'm/d/y'); //m/d/y } $data[$cid]['events'][$m][] = $item; } Quote Link to comment Share on other sites More sharing options...
FooKelvin Posted November 16, 2015 Author Share Posted November 16, 2015 Thanks Barand. I have change the line of code as above. it's working! if ($sd){ $item = date_format(($sd), 'm/d/y'); //m/d/y } if ($ed){ $item .= '-' . date_format(($ed), 'm/d/y'); //m/d/y $data[$cid]['events'][$m][] = $item; //<--- Move to this line } 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.