[SOLVED] update query with multiple tables |
[eluser]maria clara[/eluser]
[quote author="flaky" date="1263402064"]it is null because $updateArray doesn't contain ','[/quote] what do you mean by ','??
[eluser]flaky[/eluser]
make this little change Code: foreach($crudTableName as $key => $value){ $updateArray[] = $value.'='.$crudColumnValues[$value]; };
[eluser]maria clara[/eluser]
[quote author="flaky" date="1263402491"]make this little change Code: foreach($crudTableName as $key => $value){ $updateArray[] = $value.'='.$crudColumnValues[$value]; }; i have tried this.. still sad to say nothings change..
[eluser]flaky[/eluser]
have you tried this Code: case $crudConfig['update']:
[eluser]Dyllon[/eluser]
Maria, You have posted several different variations of the same problem over the last few days all having to deal with undefined variables. Now I understand that you are learning and it looks like you are trying to modify/fix an application that you did not create. However the concept of a variable is very basic stuff and you should be able to understand what an undefined variable is and how to fix it and not run to the forum every time PHP tells you that you forgot to define a variable or that the array you are trying to use in a foreach is empty. Asking the forum for help every time you have a minor issue is going to be an extremely slow and unproductive way to learn as people will often just feed you a solution instead of explaining the problem. Read up on PHP and MYSQL basics, none of your issues are CI related. When you are ready to ask a CI related question here is a good place to start http://codeigniter.com/wiki/How_to_ask_a_good_question/
[eluser]maria clara[/eluser]
[quote author="Dyllon" date="1263429246"]Maria, You have posted several different variations of the same problem over the last few days all having to deal with undefined variables. Now I understand that you are learning and it looks like you are trying to modify/fix an application that you did not create. However the concept of a variable is very basic stuff and you should be able to understand what an undefined variable is and how to fix it and not run to the forum every time PHP tells you that you forgot to define a variable or that the array you are trying to use in a foreach is empty. Asking the forum for help every time you have a minor issue is going to be an extremely slow and unproductive way to learn as people will often just feed you a solution instead of explaining the problem. Read up on PHP and MYSQL basics, none of your issues are CI related. When you are ready to ask a CI related question here is a good place to start http://codeigniter.com/wiki/How_to_ask_a_good_question/[/quote] hi, thanks.
[eluser]maria clara[/eluser]
[quote author="flaky" date="1263403333"]have you tried this Code: case $crudConfig['update']: ive tried this and it works. i just added some scripts on it. thanks. thanks, maria ![]()
[eluser]seanloving[/eluser]
[quote author="flaky" date="1263391209"]a fast example Code: $this->db->where('column', $data['column_name']); Hi, I'm trying to write a query that will update some columns in the 'customers' table, some other columns in the 'contacts' table, and some other columns in the 'organizations' table. The 'customers' table has columns for 'contact_id' and 'organization_id' where I store foreign keys to their respective tables. Here is a truncated example Code: $this->db->set('contacts.firstname', $data['firstname']); I echo the generated SQL and I havn't been able to get the JOIN to work, or even to appear :down: . Does anyone on this thread know what I'm doing wrong? Thanks
[eluser]maria clara[/eluser]
Quote:Hi, hi, can you post the errors if you have or what errors show in your console???
[eluser]maria clara[/eluser]
@seanloving, i have this code for update and it works..but it doesn't have a validation.. you can try this: Code: $sql = 'update '.$crudTableName.' set '; but i used $crudColumns here. regards, kahtrina |
Welcome Guest, Not a member yet? Register Sign In |