|
|
|||||||||
|
|||||||||
|
|||||||||
| |
|||
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Display Modes |
|
|
|
Stay one step ahead of the competition. Evaluate and give feedback
on some of the hottest web development tools on the market today.
Make your opinion heard! Click
Here
|
|
#1
|
|||
|
|||
|
I'm trying to use PHP to execute a stored procedure on SQL Server 2000 - I'm only trying to insert data in the two fields that comprise a single table (starting small!):
My table is called MeetMinutes and is defined as: NameOfFile VARCHAR MeetDate SMALLDATETIME Because PHP doesn't have a DATE type, I'm using SQLVARCHAR in both mssql_bind statements. My php fragment: PHP Code:
I keep getting the final "Couldn't update the database" message - I've tried running the procedure in SQL and it's having trouble converting from a VARCHAR to a date/time. I've tried all manner of CAST/CONVERT functions but with no success. The stored proc. is (latest version!): CREATE PROCEDURE UpdateMinutes @Filename VARCHAR (50), @MeetDate VARCHAR (10) --I assume this has to match the PHP AS INSERT INTO MeetMinutes (NameOfFile,MeetingDate) VALUES ('@Filename',CAST ('@MeetDate' AS SMALLDATETIME)) GO It's probably something fairly basic as I'm very new to this - any help gratefully received. Last edited by AJPeck : December 9th, 2002 at 09:25 AM. |
|
#2
|
|||
|
|||
|
Didn't see this post untill after i posted my example. Look here for a quick example of running a SP on a MSSQL server with PHP.
Hope it helps. URL |
![]() |
| Viewing: Dev Articles Community Forums > Databases > Microsoft SQL Server > Stored procedure in SQL2000 |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|