Unable to update a field to null/empty
Posted: Mon Apr 27, 2009 8:15 am
Greetings, I use PHP and MySql. At first glance, the following lines seem to lack any problems, well actually they do. When I test them in my environment they work well, except when I try to "delete" the string, thus setting it to empty. When I set it to null/empty it doesn't change at all, I mean it remains the same. When I change it to another not empty string it works well.
and:
I'll be very thankful to the lad that helps me
Code: Select all
$sign = $_POST['sign'];
if ($sign != $_SESSION['sign']){
$instruct = "UPDATE $table SET sign='$sign' WHERE user='$user'";
$res = mysql_query($instruct);
$alert_string = "<small>Signature has been updated</small>";
$_SESSION['sign'] = $sign;
Code: Select all
<td height=40>Semn?tura:</td> <td><input class="red" name="sign" type="text" id="sign" MAXLENGTH=100 SIZE=70 value="<?php echo $_SESSION['sign'];?>"></td>