|
-
Oct 3rd, 2006, 12:59 PM
#1
Thread Starter
Frenzied Member
Insert error
I keep getting this error below when i try to insert data into my db any ideas?
You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'damaged beyond repair.)' at line 1INSERT INTO home_app(MBlock_Part_Number,MBlock_Ref,MBlock_Defect) VALUES (WEy73473,242342,Block is damaged beyond repair.)
</table>
<?php
if(isset($_POST['submitted'])){$errors = array();
}
if(empty($_POST['partnumber'])){$errors[] = 'You forgot a part number. ';
}else{$partnumber = trim($_POST['partnumber']);
}
if(empty($_POST['refnumber'])){$errors[] = 'You forgot a ref number. ';
}else{$refnumber = trim($_POST['refnumber']);
}
if(empty($_POST['partcomments'])){$errors[] = 'You forgot part comments. ';
}else{$partcomments = trim($_POST['partcomments']);
}
require_once ('mysql_connect.php');
$query = "INSERT INTO home_app(MBlock_Part_Number,MBlock_Ref,MBlock_Defect) VALUES ($partnumber,$refnumber,$partcomments)";
$result = @mysql_query($query);
if($result){echo 'Information entered into DB';
}else{echo '<p>'. mysql_error(). $query . '</p>';
include("DSS_Footer.php");
exit();
}
?>
<?php include("DSS_Footer.php"); ?>
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|