Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

 
Reply to this topicStart new topic
> Kilka zapytań zamienić w jedno
in5ane
post
Post #1





Grupa: Zarejestrowani
Postów: 1 335
Pomógł: 34
Dołączył: 9.11.2005
Skąd: Wrocław

Ostrzeżenie: (10%)
X----


Cześć. Można to jakoś upchnąć w jedno zapytanie:
  1. function edit_meta_tags($data)
  2. {
  3. $data_c = array('content' => $data['title']);
  4. $this->db->where('name', 'title');
  5. $this->db->update('settings', $data_c);
  6.  
  7. $data_c = array('content' => $data['slogan']);
  8. $this->db->where('name', 'slogan');
  9. $this->db->update('settings', $data_c);
  10.  
  11. $data_c = array('content' => $data['description']);
  12. $this->db->where('name', 'description');
  13. $this->db->update('settings', $data_c);
  14.  
  15. $data_c = array('content' => $data['keywords']);
  16. $this->db->where('name', 'keywords');
  17. $this->db->update('settings', $data_c);
  18. }

Baza wygląda tak:
name (text) || content (text)

Z góry dziękuję za pomoc.
Go to the top of the page
+Quote Post
szok
post
Post #2





Grupa: Zarejestrowani
Postów: 165
Pomógł: 20
Dołączył: 2.03.2006

Ostrzeżenie: (0%)
-----


Hm czy to jest framework CodeIgniter?

Jak tak to masz metodę update_batch()

http://ellislab.com/codeigniter/user-guide...ive_record.html
Go to the top of the page
+Quote Post

Reply to this topicStart new topic
2 Użytkowników czyta ten temat (2 Gości i 0 Anonimowych użytkowników)
0 Zarejestrowanych:

 



RSS Aktualny czas: 8.10.2025 - 08:33