我使用以下代码,它不显示任何内容,只是一个新行。可能有什么不对?感谢。
$result = mysql_query($sql);
echo($result."<br>");
整个代码,
<?php
include 'dbc.php';
$LeadFirstName = $_POST['LeadFirstName'];
$LeadFirstName = $_POST['LeadFirstName'];
$LeadEmail =$_POST['LeadEmail'];
$LeadEmail2 =$_POST['LeadEmail2'];
$LeadPhone =$_POST['LeadPhone'];
$LeadCity =$_POST['LeadCity'];
$LeadAddress =$_POST['LeadAddress'];
$LeadPostcode =$_POST['LeadPostcode'];
$LeadUserId =$_POST['LeadUserId'];
$LeadLeadStatusId =$_POST['LeadLeadStatusId'];
$LeadMonth =$_POST['LeadMonth'];
$LeadAreas =$_POST['LeadAreas'];
$LeadMinPrice =$_POST['LeadMinPrice'];
$LeadMaxPrice =$_POST['LeadMaxPrice'];
$LeadMinBedrooms =$_POST['LeadMinBedrooms'];
$LeadMaxBedrooms =$_POST['LeadMaxBedrooms'];
$LeadMinBathrooms =$_POST['LeadMinBathrooms'];
$LeadMaxBathrooms =$_POST['LeadMaxBathrooms'];
$LeadMinYear =$_POST['LeadMinYear'];
$LeadNextFollowup_mm =$_POST['LeadNextFollowup_mm'];
$LeadNextFollowup_dd =$_POST['LeadNextFollowup_dd'];
$LeadNextFollowup =$_POST['LeadNextFollowup'];
$sql="INSERT INTO 'realtorl_leads'.`data (`LeadFirstName`, `LeadLastName`, `LeadEmail`, `LeadEmail2`, `LeadPhone`, `LeadCity`, `LeadAddress`, `LeadPostcode`, `LeadUserId`, `LeadLeadStatusId`, `LeadMonth`, `LeadAreas`, `LeadMinPrice`, `LeadMaxPrice`, `LeadMinBedrooms`, `LeadMaxBedrooms`, `LeadMinBathrooms`, `LeadMaxBathrooms`, `LeadMinYear`, `LeadNextFollowup_mm`, `LeadNextFollowup_dd`, `LeadNextFollowup`) VALUES ($LeadFirstName, $LeadLastName, $LeadEmail, $LeadEmail2, $LeadPhone, $LeadCity, $LeadAddress, $LeadPostcode, $LeadUserId, $LeadLeadStatusId, $LeadMonth, $LeadAreas, $LeadMinPrice, $LeadMaxPrice, $LeadMinBedrooms, $LeadMaxBedrooms, $LeadNextFollowup_mm, $LeadNextFollowup_dd, $LeadNextFollowup)";
$result = mysql_query($sql);
echo($result."<br>");
if (mysql_affected_rows($result)){
echo("worked");
}else {
echo("does not work");
}
?>
答案 0 :(得分:1)
您错过了查询中的'签名。
$sql="INSERT INTO 'realtorl_leads'.`data (`LeadFirstName`,
^
正确的查询将是
$sql="INSERT INTO 'realtorl_leads'.`data` (`LeadFirstName`,
现在应该可以了。