monarch_684
08-15-2007, 12:27 PM
I have no clue why this is not working so can some see if they spot a problem.
$id = $_GET["id"];
$connection = mysql_connect("localhost", "xxx", "xxx");
@mysql_select_db("xxx", $connection) or die( "Unable to select database" . mysql_error());
$query = "SELECT * FROM rates WHERE id = '{$id}'";
$result = mysql_query($query)
or die ("Couldn't query data" . mysql_error());
echo "<form method='post' action='editsubmit.php?id=".$row['id']."'>\n";
echo "<table>\n";
while ($row = mysql_fetch_array($result)) {
echo "<tr align='center'>\n";
echo "<td>", $row['id'], "</td>";
echo "<td>", $row['name'], "</td>\n";
echo "<td><input type='text' value='", $row['d_e'], "' size='10' name='d' /></td>\n";
echo "<td><input type='text' value='", $row['c'], "' size='10' name='c' /></td>\n";
echo "<td><input type='text' value='", $row['b'], "'size='10' name='b' /></td>\n";
echo "<td><input type='text' value='", $row['a'], "' size='10' name='a' /></td>\n";
echo "</tr>\n";
}
echo "</table>\n";
echo "<p><input type='submit' value='Update' /></p>";
echo "</form>";
mysql_close();
?>
The
echo "<form method='post' action='editsubmit.php?id=".$row['id']."'>\n";
does not place the id in the url. Is there something that I might of missed.
$id = $_GET["id"];
$connection = mysql_connect("localhost", "xxx", "xxx");
@mysql_select_db("xxx", $connection) or die( "Unable to select database" . mysql_error());
$query = "SELECT * FROM rates WHERE id = '{$id}'";
$result = mysql_query($query)
or die ("Couldn't query data" . mysql_error());
echo "<form method='post' action='editsubmit.php?id=".$row['id']."'>\n";
echo "<table>\n";
while ($row = mysql_fetch_array($result)) {
echo "<tr align='center'>\n";
echo "<td>", $row['id'], "</td>";
echo "<td>", $row['name'], "</td>\n";
echo "<td><input type='text' value='", $row['d_e'], "' size='10' name='d' /></td>\n";
echo "<td><input type='text' value='", $row['c'], "' size='10' name='c' /></td>\n";
echo "<td><input type='text' value='", $row['b'], "'size='10' name='b' /></td>\n";
echo "<td><input type='text' value='", $row['a'], "' size='10' name='a' /></td>\n";
echo "</tr>\n";
}
echo "</table>\n";
echo "<p><input type='submit' value='Update' /></p>";
echo "</form>";
mysql_close();
?>
The
echo "<form method='post' action='editsubmit.php?id=".$row['id']."'>\n";
does not place the id in the url. Is there something that I might of missed.