Welcome Guest, Not a member yet? Register   Sign In
Database Help Please
#1

[eluser]Michael Nielsen[/eluser]
Hi, I'm building a basic CMS with CI. What I want to accomplish when I add a new product is for the basic information such as Price, Title and Manufacture to be placed into the product table and then I want to add the much more detailed info such as RAM, HHD ect into another table.

Currently I add info to a table like:

Code:
$this->db->insert('product', $_POST);

How would I do this?
#2

[eluser]Dam1an[/eluser]
When you process the form submit, just manually take each item you want from the POST array
Code:
$basic['price'] = $_POST['price'];
$basic['manufacturer'] = $_POST['manufacturer'];
...
$this->db->insert('basic', $basis);

$detailed['ram'] = $_POST['ram'];
$detailed['hdd'] = $_POST['hdd'];
...
$this->db->insert('details', $details);
#3

[eluser]Michael Nielsen[/eluser]
Thanks, I shall give it a go...




Theme © iAndrew 2016 - Forum software by © MyBB