Jump to content


Photo

myssql problem


  • Please log in to reply
No replies to this topic

#1 tecdesign

tecdesign
  • Members
  • PipPipPip
  • Advanced Member
  • 33 posts

Posted 01 June 2006 - 05:02 AM

I know this is php but I need this for a php section. Could someone please help? The code is the following


CREATE 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?




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users