tecdesign Posted June 1, 2006 Share Posted June 1, 2006 I know this is php but I need this for a php section. Could someone please help? The code is the followingCREATE PROCEDURE hire_toy @memberid int = NULL, @toyid int = NULL, @hiredate datetime = NULL AS --IF @memberid = NULL PRINT 'Mem is null' --IF @toyid = NULL PRINT 'toy is null' --IF @hiredate = NULL PRINT 'hiredate is null' IF(@memberid = NULL OR @toyid = NULL OR @hiredate = NULL) BEGIN RAISERROR('Please enter all required parameters: Member id, Toy id, Hiredate',16,1) RETURN END print 'debug 0' INSERT INTO Hire (Member_Id, Toy_Id, Hire_Date) VALUES (@memberid, @toyid, @hiredate) print 'debug 1' IF @@ERROR <> 0 BEGIN print 'error occured' END ELSE BEGIN print 'updating toy status: id: ' + CONVERT(varchar(16), @toyid) UPDATE Toys SET Status = 'Hired' WHERE Id = @toyid END print 'debug 2'- Only gets output of: debug 0 - Updates fine but nothing beyond the insert is executed!?So once the information has been inserted into Hire it does nothing else? It seems strange is there anyone who can help? Quote Link to comment https://forums.phpfreaks.com/topic/10925-myssql-problem/ 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.