como hacer que se grabe un campo sin comillas?

Este post en realidad pertenece al que mandé antes, pero quizá sepa cual es el problema y la solucion sea simple. Me parece que los campos geométricos necesitan no tener comillas, a ver si con un ejemplo se entiende:

si pruebo de grabarlo como:




set poligono='geomFromText("POLYGON((-38.011067436808

-57.553310960449,-38.020534366999 -57.561035722412,-38.030000074349

-57.541466325439,-38.010661683903 -57.54198130957,-38.011067436808

-57.553310960449))")'



me da error, pero si hago:




geomFromText("POLYGON((-38.011067436808

-57.553310960449,-38.020534366999 -57.561035722412,-38.030000074349

-57.541466325439,-38.010661683903 -57.54198130957,-38.011067436808

-57.553310960449))")



funciona, claro que desde el sql workbench o algo parecido, pienso que quizá el yii le esté poniendo comillas y ese sea el problema, a ustedes que les parece???

Gracias

Try to serialize / unserialize before save to the database

Its definitively a problem with how the text is encoded by the database or pdo

Ps. Sorry for the english, but i know you can understand it, because of the other post

Gustavo, I think it will not work because it’s a polygon field type and mysql validates its format before storing it, what do you think? (besides I think yii will put the quotes anyway)

might be, i think its worth to try

My guess is that PDO is doing it

how are you saving?




$model->text=$asd;



?

if yes, try




$model->insert(array('field'=>$value));

//or update, without binding the value



that wont trigger the PDO’s bindValue

Hello Gustavo!!

I’m doing this:




$this->poligono = new CDbExpression($valor)



by an advise from seba.

I like this way to, the both performe the same?

>>$model->insert(array(‘field’=>$value));

cheers

Juan

Yes, the way sebas said is easier tho, allowing you to use $model->save() like you normally do, without the insert command