Hello everyone,
I have got class system going on where object is created for each column in mysql table upon initialization of the class.
This class contains one particular attribute($this->table) where i set my table name. This attribute helps in constructing a query when user press "add" to add stuff in the DB via HTML page.
It works fine as it is but I am now faced with a situation where i am required to update two tables simultaneously.
Lets say my HTML page has 3 columns "tel", "mobile", "email" which are in table "contacts". So when i press 'add' it grabs the table name from this->table when constructing a insert into query and adds it to DB.
Now, i have another column 'name' which is in another table, 'user'. I will be displaying the contents of 'name' on a HTML page constructed via class which is not a problem. The problem is when user decides to update the 'name'!
I have an issue here because my add button will go and look into this->table to find the name of table but now, since i have two tables to update, how to accomplish that!!!
Your help is much appreciated