CodeIgniter Forums
Inserting data - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20)
+--- Forum: Archived General Discussion (https://forum.codeigniter.com/forumdisplay.php?fid=21)
+--- Thread: Inserting data (/showthread.php?tid=12578)



Inserting data - El Forum - 10-24-2008

[eluser]nws123[/eluser]
Hello.
How in "Codeigniter style" make these query's

Code:
mysql_query("UPDATE mailng_list SET name = '$name', surname = '$surname'
WHERE mail_id = '$mail_id' AND userId = '$userId' ");

mysql_query("UPDATE mailng_list_entry SET email = '$email'
WHERE mail_id = '$mail_id' ");

i know userId and mail_id

More information:

mailng_list
===========
mail_id
userId
name
surname


mailng_list_entry
=================
mail_id
email

relationship: mailng_list.mail_id -> mailng_list_entry.mail_id (LEFT JOIN)

Any help please.


Inserting data - El Forum - 10-24-2008

[eluser]sl3dg3hamm3r[/eluser]
CI's active record class is very well described. Why not give it a try reading first?


Inserting data - El Forum - 10-24-2008

[eluser]James Bolongan[/eluser]
Hello......

Code:
$this->db->query("UPDATE mailng_list SET name = '$name', surname = '$surname'
WHERE mail_id = '$mail_id' AND userId = '$userId' ");

$this->db->query("UPDATE mailng_list_entry SET email = '$email'
WHERE mail_id = '$mail_id' ");

Just try to read the Database Class in code igniter user guide....just have fun in CI...its really good to have this framework..