我似乎在将记录插入数据库时遇到问题。我收到了成功消息,但是当我查看数据库中的信息时,所有字段都是木板。我的语法有错误吗?
if(isset($_POST['client'])) {
$id = (int)$id;
$client_to_insert = mysql_real_escape_string($_POST['client']);
$contact_to_insert = mysql_real_escape_string($_POST['contact']);
$title_to_insert = mysql_real_escape_string($_POST['title']);
$assigned_to_insert = mysql_real_escape_string($_POST['assigned']);
$start_date_to_insert = stripslashes($_POST['start_date']);
$end_date_to_insert = stripslashes($_POST['end_date']);
$status_to_insert = mysql_real_escape_string($_POST['status']);
$amount_to_insert = mysql_real_escape_string($_POST['amount']);
$costs_to_insert = mysql_real_escape_string($_POST['costs']);
$costs2_to_insert = mysql_real_escape_string($_POST['costs2']);
$costs_item_to_insert = mysql_real_escape_string($_POST['costs_item']);
$costs_item2_to_insert = mysql_real_escape_string($_POST['costs_item2']);
$notes_to_insert = mysql_real_escape_string($_POST['area']);
$feeA_to_insert = mysql_real_escape_string($_POST['feeA']);
$feeB_to_insert = mysql_real_escape_string($_POST['feeB']);
$feeC_to_insert = mysql_real_escape_string($_POST['feeC']);
$feeD_to_insert = mysql_real_escape_string($_POST['feeD']);
$feeE_to_insert = mysql_real_escape_string($_POST['feeE']);
$feeF_to_insert = mysql_real_escape_string($_POST['feeF']);
$feeG_to_insert = mysql_real_escape_string($_POST['feeG']);
$feeH_to_insert = mysql_real_escape_string($_POST['feeH']);
$feeI_to_insert = mysql_real_escape_string($_POST['feeI']);
$feeK_to_insert = mysql_real_escape_string($_POST['feeK']);
$feeL_to_insert = mysql_real_escape_string($_POST['feeL']);
$feeM_to_insert = mysql_real_escape_string($_POST['feeM']);
$feeN_to_insert = mysql_real_escape_string($_POST['feeN']);
$contract_to_insert = mysql_real_escape_string($_POST['contract']);
$outofhouse_to_insert = mysql_real_escape_string($_POST['outofhouse']);
$vendor_to_insert = mysql_real_escape_string($_POST['vendor']);
$vendor1_to_insert = mysql_real_escape_string($_POST['vendor1']);
$billed_to_insert = mysql_real_escape_string($_POST['billed']);
$billing_need_to_insert = mysql_real_escape_string($_POST['billing_need']);
$extended_billing_to_insert = mysql_real_escape_string($_POST['extended_billing']);
$contract_value_to_insert = mysql_real_escape_string($_POST['contract_value']);
$retainer_value_to_insert = mysql_real_escape_string($_POST['retainer_value']);
$query = mysql_query("INSERT INTO projects (
id,
client,
contact,
title,
assigned,
start_date,
end_date,
status,
amount,
costs,
costs2,
costs_item,
costs_item2,
notes,
feeA,
feeB,
feeC,
feeD,
feeE,
feeF,
feeG,
feeH,
feeI,
feeK,
feeL,
feeM,
feeN,
contract,
billed,
billing_need,
extended_billing,
vendor,
vendor1,
outofhouse,
retainer_value,
contract_value
)
VALUES (
'$id' ,
'$client' ,
'$contact' ,
'$title' ,
'$assigned' ,
'$start_date' ,
'$end_date' ,
'$status' ,
'$amount' ,
'$costs' ,
'$costs2' ,
'$costs_item' ,
'$costs_item2' ,
'$notes' ,
'$feeA' ,
'$feeB' ,
'$feeC' ,
'$feeD' ,
'$feeE' ,
'$feeF' ,
'$feeG' ,
'$feeH' ,
'$feeI' ,
'$feeK' ,
'$feeL' ,
'$feeM' ,
'$feeN' ,
'$contract' ,
'$billed' ,
'$billing_need' ,
'$extended_billing' ,
'$vendor' ,
'$vendor1' ,
'$outofhouse' ,
'$retainer_value' ,
'$contract_value' );");
if($query) {
$message = "Success your Project has been added!";
}else{
$message = "An error occurred while adding this Project";
}
}
?>