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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T23:15:39+00:00 2026-06-13T23:15:39+00:00

I have an issue with my script somewhere but do not know exactly where

  • 0

I have an issue with my script somewhere but do not know exactly where it is incorrect. Here is the code:

<title>Log</title>
</head>

<h1> Log </h1>

<form method="get" action="getlog.php"> 

<table width="300" border="0">
  <tr>
    <td> Forte ID:</td>
    <td><select id="ForteID" name="ForteID">                    
                    <option value="nc4682">nc4682</option>
                    <option value="bs1441">bs1441</option>
                    <option value="sp3212">sp3212</option>                 
        </select></td>
  </tr>
</table>

 <input type="submit" name="getLog" value="Get Log">
 </form> 

</head>

<body>
</body>
</html>
<?php
/*print_r($_POST);*/
$serverName = 'SRB-Nick_Desktop\SQLEXPRESS';
$connectionInfo = array('Database'=>'cslogs', 'UID'=>'cslogslogin', 'PWD'=>'123456');
$connection = sqlsrv_connect($serverName, $connectionInfo);

$query = 'SELECT    ForteID, Disposition, appNumber, Finance_Num, Num_Payments, ACH_CC,     Notes from logs';

$result = sqlsrv_query($connection,$query);

if (!$result) 
{
    $message = 'ERROR: ' . sqlsrv_errors();
    return $message;
}
else
{
    $i = 0;
    echo '<html><body><table><tr>';
    while ($i < sqlsrv_num_rows($result))
    {
        $meta = sqlsrv_fetch($result, $i);
        echo '<td>' . $meta->name . '</td>';
        $i = $i + 1;
    }
    echo '</tr>';

    while ( ($row = sqlsrv_fetch_array($result))) 
    {
        $count = count($row);
        $y = 0;
        echo '<tr>';
        while ($y < $count)
        {
        $c_row = current($row);
        echo '<td>' . $c_row . '</td>';
        next($row);
        $y = $y + 1;
    }
    echo '</tr>';
}
sqlsrv_free_stmt ($result);

echo '</table></body></html>';
}
sqlsrv_close( $connection);
?>

And this is what I get in result, no matter what is selected in the drop down box and hit the button get log.

nc4682 nc4682 Save Save asdf asdf fdas fdas 1 1 cc cc asdf asdf
bs1441 bs1441 LOC LOC AN00336862 AN00336862 None None 0 0 ach ach Backout Backout
nc4682 nc4682 Save Save AN00336862 AN00336862 easdf easdf 2 2 ach ach asdf asdf
sp3212 sp3212 Sale Sale NCXXXXXX1 NCXXXXXX1 none none 1 1 cc cc asdfasdfasdf asdfasdfasdf

Each column is duplicated. There are supposed to be 7 columns.

  • 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-13T23:15:40+00:00Added an answer on June 13, 2026 at 11:15 pm

    To only show the results from the drop down list you would append something like
    WHERE ForteID = {$_GET[‘ForteID’]}
    to the end of your SQL statement.

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

Sidebar

Related Questions

I have a little problem with javascript form submit issue, here is the script
I am stuck with a peculiar issue here. I have a script that basically
I have an issue regarding sending form values to a script. I have a
I think this is an issue in code somewhere, but the code's so simple
I have an issue with my generator script. Here is the command I am
I have a script that works great in FF and Safari, but does not
I have the strangest issue. I have a script that calculates what the current
I have a Python script that needs to issue a number of shell commands.
I have a script that somebody from SO kindly provided to solve an issue
I have a batch script, I think my issue has to do with parentheses

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.