LoboDirect Posted September 27, 2009 Share Posted September 27, 2009 I am trying to make a function in PHP using MySql that given Make_Html_Table($Table_A, $Table_B) will make a table that displays only the cols that are $Table_A.Visible="CHECKED", and order by $Table_A.Sort_Order. Table_A must have entries for each field in Table_B, I have been killing myself to try to do this dynamically in php by loading it into an array, then sorting it, then blah. blah.... After about three days of no sleep. Lots of yelling, I decided to ask for help. Never done that before. Then I thought perhaps there was a way to do this in mysql. select Table_A.Field as colheader where Table_A.Visibile = CHECKED, select Table_B.* where Visible etc... I dont know. I am not sure if this can even be done in mysql. Prob not. I am screwed. I need some sleep. Ok. Just in case it can be done here are the table structures for Or if you have any advice that might help. Please feel free to pontificate..... Thanks in advance for your time to view this post. Mark St. Louis. -------------------------------------------------------- -- Server version: 5.0.45 -- PHP Version: 5.2.3 -- -- Database: `nds` -- -- Table structure for table `Views` -- CREATE TABLE `Views` ( `View_Id` int(11) NOT NULL auto_increment, `Job_Id` varchar(100) NOT NULL, `Field_Header` varchar(100) NOT NULL, `DB_Field` varchar(100) NOT NULL, `Visible` varchar(20) NOT NULL, `Sort_Order` tinyint(4) NOT NULL, `Description` varchar(100) NOT NULL, `View_Type` varchar(25) NOT NULL, PRIMARY KEY (`View_Id`) ) ENGINE=MyISAM AUTO_INCREMENT=81 DEFAULT CHARSET=utf8 AUTO_INCREMENT=81 ; -- -- -- Table structure for table `Jobs` -- CREATE TABLE `Jobs` ( `Job_Id` int(11) NOT NULL auto_increment, `Job_PO` varchar(200) default NULL, `Job_Receiving_Record` int(20) default NULL, `Job_Vendor` varchar(200) default NULL, `Job_Description` varchar(200) default NULL, `Job_Qty_Received` varchar(200) default NULL, `Job_Packaging_In` varchar(200) default NULL, `Job_Weight_In` varchar(200) default NULL, `Job_Date_In` varchar(200) default NULL, `Job_Carrier` varchar(200) default NULL, `Job_Comments` varchar(200) default NULL, `Job_Qty_Out` varchar(200) default NULL, `Job_Packaging_Out` varchar(200) default NULL, `Job_Date_Out` varchar(200) default NULL, `Job_Tracking_Num` varchar(200) default NULL, `Job_Item_Num` varchar(200) default NULL, `Job_Model_Num` varchar(200) default NULL, `Job_Qty_Rec` varchar(100) NOT NULL, PRIMARY KEY (`Job_Id`) ) ENGINE=MyISAM AUTO_INCREMENT=261 DEFAULT CHARSET=utf8 AUTO_INCREMENT=261 ; -- Quote Link to comment https://forums.phpfreaks.com/topic/175704-help-with-query-of-two-tables-to-make-a-html-table-based-on-first-due-monday/ Share on other sites More sharing options...
fenway Posted October 5, 2009 Share Posted October 5, 2009 I don't understand what the output is supposed to look like. Quote Link to comment https://forums.phpfreaks.com/topic/175704-help-with-query-of-two-tables-to-make-a-html-table-based-on-first-due-monday/#findComment-930745 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.