PHP and using a stored procedure to insert money value
I am using PHP 5.6.25, developing localhost -Windows 10.
I am passing a money value to my stored procedure. The money value was extracted from an email. It contains a decimal point - no currency symbol etc. -
I have trimmed the value and when I view it via I.E view source, it doesn't appear that I am picking up any trash, and that doesn't mean it isn't just because I can "see" it displayed. But my stored procedure sure doesn't like the value I am passing.
I have used this very same stored procedure, under like circumstances i.e. pulling data, including a money amount that only contains a decimal point, and it works every time.
The table column is defined as money.
If I set my variable to a value i.e. $mymoney = '123.66' - it will insert the record every time. I read about money_format but that is invalid in Windows.
What must I do to ensure that I have stripped the parsed value to just numbers a decimal point ?? What am I failing to understand ?? or Do ??
I have included my stored procedure.
USE [SomeDB]GO/****** Object: StoredProcedure [dbo].[ins_new_importIDocInfo] Script Date: 12/6/2019 7:46:07 PM ******/SET ANSI_NULLS ONGOSET QUOTED_IDENTIFIER OFFGOALTER PROCEDURE [dbo].[ins_new_importIDocInfo] @StoreId int, @Supplier nvarchar(50), @IDoc nvarchar(50), @AmtRcvd money, @DateRcvd datetime, @RECID INT OUTPUT as Insert Into importIDocInfo(StoreId,Supplier,IDoc,AmtRcvd,DateRcvd) Values(@StoreId,@Supplier,@IDoc,@AmtRcvd,@DateRcvd) SELECT @RECID = SCOPE_IDENTITY()RETURN @RECID
Open in new window