Welcome Guest, Not a member yet? Register   Sign In
Using MySQL blobs -- CI vs php mysql functions
#1

[eluser]fMertins[/eluser]
Hi,

I´m saving blobs in MySQL, and I´m afraid that doesn´t works when using the database class from CI. I´ve made one example using CI methods and other example using MySQL php functions, here are the files:

BLOB ok
BLOB not ok

It seems CI database do a kind of convertion or translation characters...

Here is the code from BLOB ok
Code:
public function upd(Categoria $cate) {
      $upd = "update categoria set imagem_barrinha = '" . $cate->imagemBarrinha . "' where codcategoria = " . $cate->codCategoria;
      $bdok = mysql_query($upd);
      
      $dbMysql = mysql_connect("127.0.0.1", "root", "...");
      mysql_select_db("benklin", $dbMysql);
  
      if (!$bdok) {
         die("Erro ao alterar cliente. Comando SQL: " . $update);
      }
   }

And here is the code from BLOB not ok
Code:
public function upd(Categoria $cate) {
      $dados = array(
      "imagem_barrinha" => $cate->imagemBarrinha,
      );
      
      $this->db->where("codcategoria", $cate->codCategoria);
      $this->db->update("categoria", $dados);
   }

I´m missing something when using CI database, or doing something wrong?
Thanks!




Theme © iAndrew 2016 - Forum software by © MyBB