3

I am using Zend DB Table and DB Table Row. When I get a row object for any of my tables, I see that the types have all been changed to strings, even the auto-incrementing primary key.

Is that normal? Do I need to explicitly define the schema to get around this? (I thought I'd read all the Zend DB documentation. Can't recall anything about this though.)

1 Answer 1

3

As Zend_Db uses PDO for most connections, you're always going to get strings back from a SELECT query.

See http://www.php.net/manual/en/pdostatement.fetchcolumn.php

Sign up to request clarification or add additional context in comments.

1 Comment

Thanks Phil. I had no idea! So, as a general rule, how would you go about using the array elements? Would you cast them in your client code whenever you used them? Or would you put getters in the DB Table or Row classes to do the conversion for you? I have read up on the DB mapper suggested by ArtWorkAD, and I don't think my system needs it in this case.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.