Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8463959
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T14:35:43+00:00 2026-06-10T14:35:43+00:00

I have a stored procedure with three parameters @startdate, @enddate and @field1 and when

  • 0

I have a stored procedure with three parameters @startdate, @enddate and @field1 and when I try to execute the following php code, I get error

undefined index: startdate
undefined index: enddate
undefined index: field1

<?php
$myServer = "instance_name"; // host/instance_name
$myUser = "username"; // username
$myPass = "password"; // paasword
$myDB = "databasename"; // database name
$dbhandle = mssql_connect($myServer, $myUser, $myPass)
or die("Couldn’t connect to SQL Server on $myServer");
$selected = mssql_select_db($myDB, $dbhandle)
or die("Couldn’t open database $myDB");

<?php
$startdate = isset($_REQUEST['startdate']) ? $_REQUEST['startdate'] : null;
$enddate = isset($_REQUEST['enddate']) ? $_REQUEST['enddate'] : null;
$field1 = isset($_REQUEST['field1']) ? $_REQUEST['field1'] : null;
?>

<form action = "thisfile.php" method = "post">
Please input startdate <input type = "text" name = "startdate" /> </br>
Please input enddate <input type = "text" name = "enddate" /> </br>
Please input field1 name <input type = "text" name = "field1" /> </br>
Please submit <input type = "submit" name = "submit" value = "submit" /> </br>
</form>

<table border = "5" id="1">

 <?php
    if (isset($startdate) && isset($enddate) ){
$query = "storedprocedure '$startdate','$enddate','field1'";
    $result = mssql_query($query);
while ($rows = mssql_fetch_array($result) ) {
echo "<tr><td>".$rows[0]."&nbsp;<td>".$rows[1]."&nbsp;
   <td>".$rows[2]."&nbsp;<td>".$rows[3]."&nbsp;
    <td>".$rows[4]."&nbsp;<td>".$rows[5]."&nbsp;";
}
}

</table>
</body>
</html>

I was just looking for three text boxes on the top and when I enter startdate, enddate and field1 names in the text boxes, it should display the output in the same page.

Edit:
My stored procedure is something similar to below :

Create procedure storedprocedure
@startdate datetime,
@enddate datetime,
@field1  varchar(50)
select date, sum(qty), sum(qty), sum(qty2), sum(qty3), sum(qty4) from table1
where date between @startdate and @enddate and field1 like @field1 + '%'
group by date
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-10T14:35:45+00:00Added an answer on June 10, 2026 at 2:35 pm

    why don’t you do try this

    if (isset($startdate) && isset($enddate) ){
    $query = "storedprocedure '$startdate','$enddate','field1'";
        $result = mssql_query($query);
    while ($rows = mssql_fetch_array($result) ) {
    echo "<tr><td>".$rows[0]."&nbsp;<td align=right>".$rows[1]."&nbsp;
       <td align=right>".$rows[2]."&nbsp;<td align=right>".$rows[3]."&nbsp;
        <td align=right>".$rows[4]."&nbsp;<td align=right>".$rows[5]."&nbsp;";
    }
    }
    

    This should stop the notice

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have two parameters in my stored procedure i.e. @startdate and @enddate. The user
So in C# to use a stored procedure I have code like the following
I have to call a stored procedure and get the results. I know there
I have a stored procedure in which if I write the following query without
I have a stored procedure with a number of parameters. I would like to
I have the following stored procedure that I working on. I have noticed that
I have a stored procedure, PROC , which receives some parameters. If one of
I have declared a stored procedure in Sybase, and one of the parameters is
I have a stored procedure in SQL Server with try catch. What I want
I have a stored procedure that uses several input parameters and insert them into

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.