I can "fix" the blank page returned on submit by (as you put it) "echo-ing out the form again to display the changes." That is completely duplicating the select query, form and navigation (thanks agian for your input on that by the way), but though the form now returns popultaed, it is in now way updated. I'm really at my wits end on this nasty little update script. GRRRRRRRRRRRR!!!!!!!!!!!!!!!!!!! 😃
<?php
require_once ('../mysql_connect.php');
mysql_select_db ('bike_shop');
//FIRST test whether the POST has been set,
if (isset($_POST['submit'])) { // Handle the form.
$Description = $_POST['description'];
$rows_per_page = 1;
$sql = "SELECT * FROM catalog";
$result = mysql_query($sql);
$total_records = mysql_num_rows($result);
$pages = ceil($total_records / $rows_per_page);
mysql_free_result($result);
$screen = $_GET['screen'];
if (!isset($screen)) $screen = 0;
$start = $screen * $rows_per_page;
$sql = "SELECT id,description FROM catalog ";
$sql .= "LIMIT $start, $rows_per_page";
$result = mysql_query($sql);
$rows = mysql_num_rows($result);
for ($i = 0; $i < $rows; $i++) {
$record=mysql_result($result,$i,"id");
$descripton=mysql_result($result,$i,"Description");
$disp_count=($screen+1);
echo "
<form action='$url' method='post'>
<div align='center'>
<table width='57%' bordercolor='#C0C0C0'>
<tr>
<td width='14%' align='right'><b>Description:</b></td>
<td colspan='2'><textarea name='description' rows='5' cols='60'>$descripton</textarea></td>
</tr>
<tr>
<td width='14%' align='right' valign='top'></td>
<td align='center'><input type='submit' value='Submit' name='submit'></td>
</tr>
</table></div>
</form>";
echo "<p align='center'><table ><tr><td>\n";
if($screen > 0)
{
$prev = $screen-1;
$prevlink = "<a href=\"".$url."?screen=$prev\">Previous</a> || ";
}
else
{
$prevlink = "Previous || ";
}
echo $prevlink;
if($screen < $pages-1)
{
$next = $screen+1;
$nextlink = "<a href=\"".$url."?screen=$next\">Next</a>";
}
else
{
$nextlink = "Next";
}
echo $nextlink ."<br>";
echo "</td></tr></table></p>";
}
}
else {
//subsequently retrieve the data from the database,
$rows_per_page = 1;
$sql = "SELECT * FROM catalog";
$result = mysql_query($sql);
$total_records = mysql_num_rows($result);
$pages = ceil($total_records / $rows_per_page);
mysql_free_result($result);
$screen = $_GET['screen'];
if (!isset($screen)) $screen = 0;
$start = $screen * $rows_per_page;
$sql = "SELECT id,description FROM catalog ";
$sql .= "LIMIT $start, $rows_per_page";
$result = mysql_query($sql);
$rows = mysql_num_rows($result);
for ($i = 0; $i < $rows; $i++) {
$record=mysql_result($result,$i,"id");
$descripton=mysql_result($result,$i,"Description");
$disp_count=($screen+1);
//and echo out the form AGAIN to display the changes.
echo "
<form action='$url' method='post'>
<div align='center'>
<table width='57%' bordercolor='#C0C0C0'>
<tr>
<td width='14%' align='right'><b>Description:</b></td>
<td colspan='2'><textarea name='description' rows='5' cols='60'>$descripton</textarea></td>
</tr>
<tr>
<td width='14%' align='right' valign='top'></td>
<td align='center'><input type='submit' value='Submit' name='submit'></td>
</tr>
</table></div>
</form>";
}
echo "<p align='center'><table ><tr><td>\n";
if($screen > 0)
{
$prev = $screen-1;
$prevlink = "<a href=\"".$url."?screen=$prev\">Previous</a> || ";
}
else
{
$prevlink = "Previous || ";
}
echo $prevlink;
if($screen < $pages-1)
{
$next = $screen+1;
$nextlink = "<a href=\"".$url."?screen=$next\">Next</a>";
}
else
{
$nextlink = "Next";
}
echo $nextlink ."<br>";
echo "</td></tr></table></p>";
}
?>