Welcome Guest, Not a member yet? Register   Sign In
insert data in database using two different tables
#1

[eluser]Unknown[/eluser]
Hi everybody,

How can i insert data in database tables using two tables.
my tables are: members and products

I Need to add to the database these data to

members - tables
- fname
- lname
- age

products - tables

- price
- product name

is anybody can help me improve my script in model?
This is my script that insert data in one table only. how can I insert the other table in just one function?

$query_str = "INSERT INTO members (fname, lname, age) VALUES (?, ?, ?)";
$this->db->query($query_str,array($fname, $lname, $age));






Theme © iAndrew 2016 - Forum software by © MyBB