List:General Discussion« Previous MessageNext Message »
From:Michael Widenius Date:September 26 1999 12:38pm
View as plain text  
>>>>> "toxalot" == toxalot  <toxalot@stripped> writes:

toxalot> I'm using perl and DBI.
toxalot> I have an edit form that outputs the content of a particular record. On
toxalot> submit of this form, I'm updating the table, but I didn't make any changes
toxalot> to the data that I am sending in the update. Shouldn't I get a return code
toxalot> of 0 if there are no changes?

toxalot> I am getting a code of 1.  What am I doing wrong? Any ideas?

toxalot> $sql="UPDATE articles SET title=\"$FORM{'title'}\",
toxalot> 							short_author=\"$FORM{'short_author'}\",
toxalot> 							long_author=\"$FORM{'long_author'}\",
toxalot> 							book_1=$FORM{'book_1'},
toxalot> 							book_2=$FORM{'book_2'},
toxalot> 							book_3=$FORM{'book_3'},
toxalot> 							book_4=$FORM{'book_4'},
toxalot> 							book_5=$FORM{'book_5'},
toxalot> 							book_6=$FORM{'book_6'},
toxalot> 							p_year=$FORM{'p_year'},
toxalot> 							article_body=\"$FORM{'article_body'}\"
toxalot> 							WHERE article_id=$FORM{'article_id'}";
toxalot> 	$rc=$dbh->do( $sql ) or die ("Do failed:  $DBI::errstr");
toxalot> 	$dbh->disconnect();
toxalot> 	if ($rc == 0) {print "There was nothing to update.<br>\n";}
toxalot> 	else {
toxalot> 		print "Changes were saved to the database.<br>\n";
toxalot> }


If you update BLOB or TEXT columns, then MySQL 3.22 will return 1.
THis problem is fixed in MySQL 3.23

UPDATEtoxalot26 Sep
  • Re: UPDATEJay J26 Sep
  • UPDATEMichael Widenius26 Sep
    • Re: UPDATEtoxalot27 Sep