Welcome Guest, Not a member yet? Register   Sign In
Issue with special characters and Ajax database updates
#2

[eluser]jsuissa[/eluser]
Think I found my answer:

BEFORE:

Code:
$sql = "UPDATE $table SET $field = $value WHERE $whereField =  $whereValue";
$query =  $this->db->query($sql);

AFTER:

Code:
$sql = "UPDATE $table SET $field = ? WHERE $whereField =  $whereValue";
$query =  $this->db->query($sql, array($value));

Just by using the ? operator for the value I wanted to change did the trick.


Messages In This Thread
Issue with special characters and Ajax database updates - by El Forum - 01-30-2012, 07:14 PM
Issue with special characters and Ajax database updates - by El Forum - 01-30-2012, 08:31 PM
Issue with special characters and Ajax database updates - by El Forum - 01-30-2012, 08:38 PM



Theme © iAndrew 2016 - Forum software by © MyBB