whizzykid Posted August 8, 2009 Share Posted August 8, 2009 My sql works when i use int data string but i cant seem to be able to insert currency signs. this is my code. GetSQLValueString($_POST['Available_balance'], "int"), Quote Link to comment https://forums.phpfreaks.com/topic/169362-solving-this/ Share on other sites More sharing options...
abazoskib Posted August 8, 2009 Share Posted August 8, 2009 currency signs, if im not mistaken, should be added when the data is parsed, not stored in the database. hopefully im on line with what you are asking. Quote Link to comment https://forums.phpfreaks.com/topic/169362-solving-this/#findComment-893654 Share on other sites More sharing options...
whizzykid Posted August 8, 2009 Author Share Posted August 8, 2009 Thanks but no tht is not what i am asking,what is the data type for me to use,when i use int i cant insert currency signs. Quote Link to comment https://forums.phpfreaks.com/topic/169362-solving-this/#findComment-893832 Share on other sites More sharing options...
abazoskib Posted August 9, 2009 Share Posted August 9, 2009 if you want to insert a $ along with a number, use varchar, although this is not the most efficient way to store money values. Quote Link to comment https://forums.phpfreaks.com/topic/169362-solving-this/#findComment-893839 Share on other sites More sharing options...
whizzykid Posted August 9, 2009 Author Share Posted August 9, 2009 Yea i did use that but i am just confused as what to use as the input type.i use GetSQLValueString($_POST['Available_balance'], "int"), Quote Link to comment https://forums.phpfreaks.com/topic/169362-solving-this/#findComment-893904 Share on other sites More sharing options...
abazoskib Posted August 9, 2009 Share Posted August 9, 2009 mssql has a money data type. and a smallmoney type if i remember correctly. use either one. when you are outputting the figure, output a currency symbol next to it. at least then you can still do math with the numbers. Quote Link to comment https://forums.phpfreaks.com/topic/169362-solving-this/#findComment-893923 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.