Jump to content

HELP WITH QUERY of two tables to make a html table based on first, DUE MONDAY :(


LoboDirect

Recommended Posts

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 ;

 

--

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.