Paul Edward Pagente
asked on
Return Data using Stored Procedure in AdoDB PHP
I am using MS SQL Server 2008 as my Database and I created a Stored Procedure that looks like this.
USE [DB_Question]
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
ALTER Procedure [dbo].[Check_ExamID]
@ExamID NVARCHAR(MAX)
as
SELECT * FROM TBL_ExamTimer WHERE ExamID = @ExamID
and here is my PHP code that suppost to be the target is to display data in my PHP site by using some criteria also.
<html>
<head>
</head>
<body>
<?php
include('config.php');
include('adodb/adodb.inc.p hp');
$db = ADONewConnection($dbdriver );
$db->Connect($dsn, $username, $password);
$procedure = $db->prepareSp('Check_Exam ID');
if (!$procedure)
die ('Invalid or inaccessible stored procedure name');
$parameter1Name = '@ExamID';
$ok = $db->inParameter($procedur e,$paramet er1Name,'1 234');
$result = $db->execute($procedure);
?>
</body>
</html>
I am trying to display data where `ExamID =@ExamID` or `1234` for param of `@ExamID`
My Target here is to use my stored procedure to select data in my table and return it back in my php file but nothings happening. TYSM
USE [DB_Question]
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
ALTER Procedure [dbo].[Check_ExamID]
@ExamID NVARCHAR(MAX)
as
SELECT * FROM TBL_ExamTimer WHERE ExamID = @ExamID
and here is my PHP code that suppost to be the target is to display data in my PHP site by using some criteria also.
<html>
<head>
</head>
<body>
<?php
include('config.php');
include('adodb/adodb.inc.p
$db = ADONewConnection($dbdriver
$db->Connect($dsn, $username, $password);
$procedure = $db->prepareSp('Check_Exam
if (!$procedure)
die ('Invalid or inaccessible stored procedure name');
$parameter1Name = '@ExamID';
$ok = $db->inParameter($procedur
$result = $db->execute($procedure);
?>
</body>
</html>
I am trying to display data where `ExamID =@ExamID` or `1234` for param of `@ExamID`
My Target here is to use my stored procedure to select data in my table and return it back in my php file but nothings happening. TYSM
This question needs an answer!
Become an EE member today
7 DAY FREE TRIALMembers can start a 7-Day Free trial then enjoy unlimited access to the platform.
View membership options
or
Learn why we charge membership fees
We get it - no one likes a content blocker. Take one extra minute and find out why we block content.
Your last line is this
Open in new window
Where do you retrieve the results and show them?
I would expect to see
Open in new window
http://adodb.org/dokuwiki/doku.php?id=v5:reference:connection:preparesp