If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Data Access, Manipulation & Batch Languages > PHP > Many-to-many Relationship Update

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 10-27-09, 13:57
socca socca is offline
Registered User
 
Join Date: Jan 2009
Posts: 16
Many-to-many Relationship Update

Hey i have been banging my head against this one for some time now.
For example:

I currently have a page that will list all of the trades an employee can provide. I do this with some PHP/MySQL
Code:
    $tradequery = sprintf("SELECT contractor_name.identifier, trades_list.id, trades_list.desc, CASE WHEN contract_trades.trade_id IS NULL THEN 'F' ELSE 'T' END AS selected FROM contractor_name CROSS JOIN trades_list LEFT JOIN contract_trades ON (contract_trades.contract_id = contractor_name.identifier AND contract_trades.trade_id = trades_list.id) WHERE (contractor_name.identifier = '%s')", $row_name['identifier']);
	$tradeq = mysql_query($tradequery, $ContractorList) or die(mysql_error());
	$row_tradeq = mysql_fetch_assoc($tradeq);
	$totalRows_tradeq = mysql_num_rows($tradeq);
I use this query to get me all of the trades they could have and then i use that information to then put a check in the check box next to the trade description, if they currently are able to do that trade. And the check box shows up empty if they currently cant.

What i am looking to do is to let a supervisor check and un-check boxes and then hit the submit button and update my table with what trades this employee can now do or remove what the employee can no longer do.

If my explanation is fuzzy, i am sorry i will explain more where i lost you.
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On