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 9306949
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 19, 20262026-06-19T00:17:09+00:00 2026-06-19T00:17:09+00:00

all, i have been lurking on stackoverflow for a few years now, always able

  • 0

all,

i have been lurking on stackoverflow for a few years now, always able to find the help needed to resolve the issue at hand. however, this time, i needed to create my first question as i was unable to find questions that hit on the same issue i am encountering.

i have been stumped for over a week and am getting into hot water at work because i already blew my estimated date. i put myself at your mercy in the hopes that you may help me with my coding headache.

i am able to return data from executing a stored procedure through PHP on a SQL 2008 server on a VM (running windows 2008 r2) where i pass in one parameter.

that parameter has a total of eleven (11) choices. whenever i pass in one (1) of those choices, expected data is returned.

however, whenever i use any of the other choices, no data is returned (and with my current code, no errors are returned either).

there are 11 choices of $application_selected to pass into the stored procedure and only one (1) of those choices returns data. none of the others return data or errors.

here is my entire code:

<!DOCTYPE html>
<html>
<head>
<title>data</title>
</head>
<body>

<?php
////////////////////////////////////////////////////////////////////////////
//connection information
$servername = "192.168.1.104";
$username = "sa";
$password = "*";
$database = "*";

$connection_info = array( "Database"=>$database, "UID"=>$username, "PWD"=>$password);
$conn = sqlsrv_connect( $servername, $connection_info);

if($conn===FALSE) die( print_r( sqlsrv_errors(), true));
else echo "<font color=\"blue\">DB Connected.</font><br>";
/////////////////////////////////////////////////////////////////////////////

$application_selected = "param1";
$sql_cmd = "EXECUTE GetApprover '$application_selected'";

$execute_this = sqlsrv_prepare($conn, $sql_cmd);
$application_proc = sqlsrv_execute($execute_this);

if($application_proc===FALSE) die( print_r( sqlsrv_errors(), true)); //execute failed; die and display errors

else echo "<font color=\"blue\">DB data retrieved.</font><br><br>";

$row_apps = "";
$count = 0;
echo "<font color=\"blue\">Attempting data output via loop</font><br><br>";

/////////////////////////////////////////////////////////////////////////////
// output data
//echo var_dump($execute_this)."<br><br>";
echo "<font color=\"blue\">Application selected = </font>\"".$application_selected."<font color=\"blue\">\" - data pulled &#9660;</font><br><br>";
while(($row_apps = sqlsrv_fetch_array($execute_this)) && (sqlsrv_fetch_array($execute_this) <> FALSE)) { //while var has data
if (!isset($row_apps)) die( print_r( sqlsrv_errors(), true));
$count += 1;
echo $row_apps['ApplicationName']." - ".$row_apps['ApproverCode']." - ".$row_apps['ApproverDesc']." - ".$row_apps['FullName']." - ".$row_apps['Email']." - ".$row_apps['UserId']."<br>";
}
/////////////////////////////////////////////////////////////////////////////////

echo "<br><font color=\"blue\">&#9650; Data displayed.";
echo "<br><br><font color=\"blue\">There were [<font color=\"red\"><b>$count</b></font>] rows returned.<br><br><br>";

echo "<br>\$servername = ";
echo var_dump($servername)."<br>";
echo "<br>\$username = ";
echo var_dump($username)."<br>";
echo "<br>\$password = ";
echo var_dump($password)."<br>";
echo "<br>\$database = ";
echo var_dump($database)."<br>";
echo "<br>\$connection_info = ";
echo var_dump($connection_info)."<br>";
echo "<br>\$conn = ";
echo var_dump($conn)."<br>";
echo "<br>\$application_selected = ";
echo var_dump($application_selected)."<br>";
echo "<br>\$sql_cmd = ";
echo var_dump($sql_cmd)."<br>";
echo "<br>\$execute_this = ";
echo var_dump($execute_this)."<br>";
echo "<br>\$application_proc = ";
echo var_dump($application_proc)."<br>";
echo "<br>\$row_apps = ";
echo var_dump($row_apps)."<br>";
echo "<br>\$count = ";
echo var_dump($count)."<br>";

echo "<br><br><br>";
sqlsrv_close($conn);
echo "<br>DB Connection closed.</font><br><br><br>";

?>
</body>
</html>
  • 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-19T00:17:10+00:00Added an answer on June 19, 2026 at 12:17 am

    it seems my preliminary suspicions (although i had no tangible proof of such) of some sort of db issue was the culprit after pushing my dba (also my director) with some test results from added debug code [like var_dump()/print_r()]. his reply to the issue that caused it all was as follows:

    “i don’t know what happened but i copied the table content from my dev environment to your dev environment and now things work.”

    i’m sorry to trouble you all with my issue. i am grateful that Marc B and Raad answered my plea for help so quickly and i really hope this question helps someone in the future.

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

Sidebar

Related Questions

I've been programming with Qt libraries for 3 years. All programs have been designed
I have been all over stackoverflow and all over Google and I cannot seem
I have been researching all over the internet about this, and unfortunately cannot find
Over the past few days, I have been trying to find an answer to
I have an assembly with multiple versions, all have been deployed in GAC. Now
I have been working on this for a few hours now, and I keep
I have been using data binding for several years with win forms, but now
I've been lurking a bit and couldn't find the answer. Basically I have a
All i have something i have been trying to do for a while and
I have been all over the place, seems the UITableView with a static background

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.