Hello,
Is there a way to load an integer value into an integer avp using avp_db_query? For example if in table usr_preferences I have value='15' and type=1, then using avp_db_load I get an avp with an int value of 15. Then I can use this int avp to check whether it is greater or less than some value. I am trying to do the same thing with avp_db_query but the avp that I get is a string.
thank you for any help
George
Disclaimer The information in this e-mail and any attachments is confidential. It is intended solely for the attention and use of the named addressee(s). If you are not the intended recipient, or person responsible for delivering this information to the intended recipient, please notify the sender immediately. Unless you are the intended recipient or his/her representative you are not authorized to, and must not, read, copy, distribute, use or retain this message or any part of it. E-mail transmission cannot be guaranteed to be secure or error-free as information could be intercepted, corrupted, lost, destroyed, arrive late or incomplete, or contain viruses.
Hello,
On 03/06/07 09:59, Papadopoulos Georgios wrote:
Hello,
Is there a way to load an integer value into an integer avp using avp_db_query? For example if in table usr_preferences I have value='15' and type=1, then using avp_db_load I get an avp with an int value of 15. Then I can use this int avp to check whether it is greater or less than some value. I am trying to do the same thing with avp_db_query but the avp that I get is a string.
that's because in usr_preferences the values are stored in a string column. If you make another table and store the value in an integer column, then it will be stored as integer in AVP.
avp_db_query() takes the type of value from type of column.
Cheers, Daniel
thank you for any help
George
Disclaimer
The information in this e-mail and any attachments is confidential. It is intended solely for the attention and use of the named addressee(s). If you are not the intended recipient, or person responsible for delivering this information to the intended recipient, please notify the sender immediately. Unless you are the intended recipient or his/her representative you are not authorized to, and must not, read, copy, distribute, use or retain this message or any part of it. E-mail transmission cannot be guaranteed to be secure or error-free as information could be intercepted, corrupted, lost, destroyed, arrive late or incomplete, or contain viruses.
Users mailing list Users@openser.org http://openser.org/cgi-bin/mailman/listinfo/users
Daniel-Constantin Mierla wrote:
Hello,
On 03/06/07 09:59, Papadopoulos Georgios wrote:
Hello,
Is there a way to load an integer value into an integer avp using avp_db_query? For example if in table usr_preferences I have value='15' and type=1, then using avp_db_load I get an avp with an int value of 15. Then I can use this int avp to check whether it is greater or less than some value. I am trying to do the same thing with avp_db_query but the avp that I get is a string.
that's because in usr_preferences the values are stored in a string column. If you make another table and store the value in an integer column, then it will be stored as integer in AVP.
avp_db_query() takes the type of value from type of column.
Also with 1.1? I just tried avp_db_query() and load an integer column type from mysql into an AVP, but the AVP is always defined as string.
Any hints were I could have an error?
regards klaus
Cheers, Daniel
thank you for any help
George
Disclaimer
The information in this e-mail and any attachments is confidential. It is intended solely for the attention and use of the named addressee(s). If you are not the intended recipient, or person responsible for delivering this information to the intended recipient, please notify the sender immediately. Unless you are the intended recipient or his/her representative you are not authorized to, and must not, read, copy, distribute, use or retain this message or any part of it. E-mail transmission cannot be guaranteed to be secure or error-free as information could be intercepted, corrupted, lost, destroyed, arrive late or incomplete, or contain viruses.
Users mailing list Users@openser.org http://openser.org/cgi-bin/mailman/listinfo/users
Users mailing list Users@openser.org http://openser.org/cgi-bin/mailman/listinfo/users
Klaus Darilion wrote:
Daniel-Constantin Mierla wrote:
Hello,
On 03/06/07 09:59, Papadopoulos Georgios wrote:
Hello,
Is there a way to load an integer value into an integer avp using avp_db_query? For example if in table usr_preferences I have value='15' and type=1, then using avp_db_load I get an avp with an int value of 15. Then I can use this int avp to check whether it is greater or less than some value. I am trying to do the same thing with avp_db_query but the avp that I get is a string.
that's because in usr_preferences the values are stored in a string column. If you make another table and store the value in an integer column, then it will be stored as integer in AVP.
avp_db_query() takes the type of value from type of column.
Also with 1.1? I just tried avp_db_query() and load an integer column type from mysql into an AVP, but the AVP is always defined as string.
Uups - I have to correct myself. If I explecitely load an int column it works, but it does not work if I load a count() or sum() value - these are always string AVPs. Even when I try CAST(count(*) AS SIGNED INTEGER) it does not work. :-(
Any hints?
thanks klaus