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)

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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.