So i have viewed other posts about this and attempted many a thing to check what the problem is, even with different coding the error still occurs as far as i know the code is sound.
please help me if you can 🙂
now im off to bed :o
Thank you in advance for any help offered
<?
require ("../../cgi-bin/connect2test.php");
# processed when form is submitted back onto itself
if ($REQUEST_METHOD=="POST") {
# setup SQL statement
$SQL = " UPDATE sqlxml SET";
$SQL = $SQL . " name = '$name', ";
$SQL = $SQL . " description = '$description' ";
$SQL = $SQL . " WHERE id = $id ";
# execute SQL statement
$result = mysql_db_query($db,"$SQL",$cid);
# check for errors
if (!$result) { echo("ERROR: " . mysql_error() . "\n$SQL\n"); }
echo ("<P><B>Data Entry Updated</B></P>\n");
} else { # display edit form (not post method)
# setup SQL statement to retrieve link
# that we want to edit
$SQL = " SELECT * FROM sqlxml ";
$SQL = $SQL . " WHERE id = $id ";
# execute SQL statement
$ret = mysql_db_query($db,"$SQL",$cid);
# retrieve values
$row = mysql_fetch_array($ret);
$name = $row["name"];
$id = $row["id"];
$description = $row["description"];
# form here
echo "<FORM NAME='edit2sql' ACTION='edit2sql.php' METHOD='POST'>
<INPUT TYPE='hidden' NAME='id' VALUE='$id'><TABLE>
<TR><TD><B>Name:</B> </TD><TD><INPUT TYPE='text' NAME='name' VALUE='$name' SIZE=40></TD></TR>
<TR><TD VALIGN=TOP><B>Description: </B> </TD><TD> <TEXTAREA NAME='description' ROWS=5 COLS=40>$description</TEXTAREA></TD></TR>
<TR><TH COLSPAN=2><P><INPUT TYPE='submit' VALUE='Update Data'></P></TH></TR>
</TABLE></FORM>";
}
mysql_close($cid);
?>