[eluser]CodyPChristian[/eluser]
Hello I'm building a quote system where the users of the site can post quotes to and they can vote/digg them up and down, everything so far is going great but I have one slight problem and I don't understand which way to go with it. Here is the current code I have.
This is where I need the new code, this is the part I don't get how to do.
Here is the full code and the way it works is /quotes/$id/up or down
Code:
function up()
{
$order_id = '0';
$id = $this->uri->segment(2);
$this->db->where('id', $id);
$this->db->set('order_id', $order_id);
$this->db->update('quotes', $_POST);
redirect('quotes');
}
function down()
{
$order_id = '0';
$id = $this->uri->segment(2);
$this->db->where('id', $id);
$this->db->set('order_id', $order_id);
$this->db->update('quotes', $_POST);
redirect('quotes');
}
I tested it above but entering a number in the $order_id and it does in fact update it to that number, so everything else is working fine, its just writing it to actually work.
I hope someone understands this. Thanks for the help!