Giang_3 0 Newbie Poster

Hi Guys,

I have a function use to moderate articles, so when i approve one article, have some bellow query:
1 - Update article status to approved:

$this->db->update("article",array("approved" => "1","date" => "NOW()"),array("id" => "?"),array($this->id));

2 - Replace some text in $description of article

$newdescription = str_replace("abc","def",$description);

3 - Update article again:

$this->db->update("article",array("description" => $newdescription),array("id" => "?"),array($this->id));

Have one problem is i can't process step 3 with text value, while it is ok with number value.
Ex:
$newdescription = "123" <- It's ok
But
$newdescription = "123c" <- It's not work

Please help me and thank you so much!

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.