I'm trying to do a very basic page that allows me to edit a single column in a MSSQL database. For whatever reason I can't figure it out and am hoping that you can help.

Here is my front page (sorry about the silly names)

$ninja_conn = odbc_connect('XXXXX','XXXX','XXXX', SQL_CUR_USE_ODBC);
	<link rel="stylesheet" type="text/css" href="style.css" />

	<div id="upper_left"></div>
	<div id="upper_right"></div>
	<div id="lower_left"></div>
	<div id="lower_right"></div>	
	<div id="page_wrap">
	  <h1>Time Clock Status</h1>
	  <br /><br />
     $sql_ninja_stats = "SELECT * from dbo.TCNinja";
     $ninja_get=odbc_exec($ninja_conn, $sql_ninja_stats);
     echo'<table border="1">
     echo "
  <td>&nbsp; &nbsp; &nbsp; </td>
  <td><select name='Status'>
      <option value=".$rows['Status']." selected='selected'>". $rows['Status']."</option>
      <option vlaue='1'>1</option>
      <option vlaue='0'>0</option>
  <td>&nbsp; &nbsp; &nbsp; </td>
  <td><a href='tcninja_update.php?ID=".$rows['ID']."'>submit</a></td>


That pulls the data fine, but when I try to submit I'm getting undefined indexes.
Here is the back end page:

$ninja_conn = odbc_connect('XXXX','XXXXX','XXXX', SQL_CUR_USE_ODBC);


$query="UPDATE dbo.TCNinja SET Status='$status' WHERE ID='$id'";

/// Perform the update ///
$result=odbc_exec($ninja_conn, $query);
/// if successfully updated. ///

else {
echo "Error";
/// close connection ///

Any suggestions?

Where is the form? And why you wrote this:

<td><a href='tcninja_update.php?ID=".$rows['ID']."'>submit</a></td>

This will generate a GET, to read ID you need to write $_GET, but you won't get Status, to get that you need to add it to the link &Status=value To submit a form like yours you need the proper tag, so you need to write:

<form method="post" action="tcninja_update.php"> <!-- this goes at the top of the form -->
<!-- select goes here... -->

<!-- before </form> add this: -->
<input type="hidden" name="ID" value="<?php echo $rows['ID']; ?>" />
<input type="submit" name="submit" value="send" />

Thanks for the info. It got me going in the correct direction!