Welcome Guest, Not a member yet? Register   Sign In
Using $this->input->post in a SQL Query Update
#1

[eluser]internut[/eluser]
Hey all. Quick question. Why would this work:

Code:
$this->db->query("UPDATE settings SET setting='$_POST[admin_name]' WHERE name='admin_name'");

and this does not:

Code:
$this->db->query("UPDATE settings SET setting='$this->input->post(admin_name)' WHERE name='admin_name'");

do i need to set the var above the query call?

$admin_name = $this->input->post(admin_name);

Can i just use $this->input->post(admin_name) in the query update?


Messages In This Thread
Using $this->input->post in a SQL Query Update - by El Forum - 07-18-2008, 12:07 PM
Using $this->input->post in a SQL Query Update - by El Forum - 07-18-2008, 12:12 PM
Using $this->input->post in a SQL Query Update - by El Forum - 07-18-2008, 12:20 PM
Using $this->input->post in a SQL Query Update - by El Forum - 07-18-2008, 12:41 PM
Using $this->input->post in a SQL Query Update - by El Forum - 07-18-2008, 12:46 PM
Using $this->input->post in a SQL Query Update - by El Forum - 07-18-2008, 01:02 PM
Using $this->input->post in a SQL Query Update - by El Forum - 07-18-2008, 01:25 PM



Theme © iAndrew 2016 - Forum software by © MyBB