Jump to content

Fun With :Truncated incorrect DOUBLE value


law

Recommended Posts

I'm updating a field that is varchar. As a test I'm passing the string "Updated Title."

Here is my error: Truncated incorrect DOUBLE value: 'Title Updated'

Here is my code

//-==========Variables========================-
$var0 = $_POST['creator'];
$var1 = $_POST['date'];
$var2 = $_POST['table'];
	$var3 = $_POST['id'];
$var4 = $_POST['body'];
$var5 = $_POST['title'];
//-==========================================-	

if ($var3 !== 0){
	$result = mysql_query("UPDATE $var2 SET title = '$var5' AND body = '$var4' AND creator = '$var0' AND date = '$var1' WHERE id = '$var3'")or die(mysql_error());
	echo "update successful";
}else {
	$result = mysql_query("INSERT INTO $var2(title, body, creator, date) VALUES('$var5', '$var4', '$var0', '$var1')");
	echo "<br/> insert successful";

 

My guess is this is some sort of syntax error. I am self taught which = I know nothing about correct syntax or structure. (or much of anything  :-X)

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.