Expand|Select|Wrap|Line Numbers
- CREATE PROCEDURE display_Products
- @CategoryID int
- AS
- BEGIN
- DECLARE @authors_cursor CURSOR
- SET @authors_cursor =CURSOR FAST_FORWARD
- FOR SELECT TOP 10 COUNT(iProductFK) AS s ,iProductFK
- FROM tblOrderDetail WHERE iProductFK IN(SELECT iProductFK FROM tblCategoryProduct WHERE iCategoryFK = @CategoryID)
- GROUP BY iProductFK
- ORDER BY s desc
- DECLARE @a int
- DECLARE @b int
- declare @c varchar(200)
- OPEN @authors_cursor
- FETCH NEXT FROM @authors_cursor INTO @a, @b
- WHILE @@FETCH_STATUS = 0
- BEGIN
- set @c=@c+convert(varchar,@b)+'*'
- FETCH NEXT FROM @authors_cursor INTO @a, @b
- END
- CLOSE @authors_cursor
- DEALLOCATE @authors_cursor
- return @c
- END
- GO
this was the code i put[php]
mssql_bind($sq_top,"@CategoryID",$LintCatID,SQLINT 4);
mssql_bind($sq_top,"RETVAL",stripslashes($pID),SQL VARCHAR,false, false, 200);
$res_top=mssql_execute($sq_top);[/php]
This was the error message i got
Warning: mssql_execute() [function.mssql-execute]: message: Syntax error converting the varchar value '71643*71318*20114*258681*20097*232296*42432*71501 *71410*233548*' to a column of data type int. (severity 16) in C:\wamp\www\lion\subcat.php on line 45
Warning: mssql_execute() [function.mssql-execute]: stored procedure execution failed in C:\wamp\www\lion\subcat.php on line 45
if anybody know how to solve this please help me