Jump to content

complicated mysql question


whatshakin

Recommended Posts

I have a complicated mysql question:

 

I have a form posting a dynamic number of yes/no radio options, that varies.  I'm catching the posts in a foreach:

foreach($_POST as $name => $value) {
        $orig_name = str_replace("-",' ',$name);
print "$orig_name : $value<br>";	
}

 

I want to grab the ID fields that match $orig_name fields from a table named "sys_acl_actions".

Then I need to insert those ID's into a field named "IDAction" and $memLvl into field "IDLevel" in the table "sys_acl_matrix".

 

I've never done any LEFT JOIN or anything and I'm very confused as to how to set this up using a foreach.  Any guidance would be really helpful. 

 

Here's a sample database function that's setup in the script already:

$data['status'] = intval($_GET['publish']);
$db->insert("sys_acl_levels", $data, "ID='" . $id . "'"); // Third argument is for the WHERE statement

Link to comment
https://forums.phpfreaks.com/topic/197928-complicated-mysql-question/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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.