我已经连续工作了2天而没有任何进展。基本上我会提取由汽车的年份,品牌和型号决定的零件清单。数据库是由其他人编写的,因此拼凑它们组成的混乱已经证明是一项非常重要的任务。所以。它从多个表中拉出多个汽车零部件,然后将它们组合在一起,首先是汽车,然后是零件编号,描述等的单个零件。即使使用该网站设计的原始代码,也可以打破这点。 ajax要求年份,制作和建模所有工作,当我到达这些代码行时,它会中断。
$vid
由yearID
表
modelyear
定义
function loadDetails($vid)
{
$modelYearDetails = "
SELECT Model,YETD.yearID,startYear,endYear,bodyType,engine,Drivetrain,Transmissions,wheelbase
FROM year_engine_tran_drive YETD
LEFT JOIN wheelbase W ON YETD.wheelbaseID = W.wheelbaseID
LEFT JOIN engines E ON YETD.engineID = E.idengines
LEFT JOIN transmissions T ON YETD.transmissionID = T.idTransmissions
LEFT JOIN drivetrains D ON YETD.driveTrainID = D.idDrivetrains
LEFT JOIN bodytype BT ON YETD.bodyTypeID = BT.idbodyType
LEFT JOIN modelyear MY ON YETD.yearID = MY.VID
LEFT JOIN model M ON MY.idModel = M.idModel
WHERE yearID IN (".$vid.")";
$stmt = $this->dbConnect->getDBHandle()->prepare($modelYearDetails);
$stmt->execute();
$cnt = 0;
foreach ($stmt->fetchAll(PDO::FETCH_ASSOC) as $row)
{
$model = $row['Model'];
$yearID = $row['yearID'];
$startYear = $row['startYear'];
$endYear = $row['endYear'];
$name = $row['bodyType'];
$engine = $row['engine'];
$driveTrain = $row['Drivetrain'];
$transmission = $row['Transmissions'];
$wheelbase = $row['wheelbase'];
$cab = $row['cab'];
$bed = $row['bed'];
echo "<header id=".$yearID.">";
echo "<a href='#".$yearID."'>";
echo "<div>".$model." ".$startYear."-".$endYear."</div>";
echo "<ul>";
echo "<li><div class='carPart'>Engine:</div> <div class='carValue'>".$engine."</div></li>";
echo "<li><div class='carPart'>Drivetrain:</div> <div class='carValue'>".$driveTrain."</div></li>";
echo "<li><div class='carPart'>Transmission:</div> <div class='carValue'>".$transmission."</div></li>";
echo "</ul>";
echo "</a>";
echo "<div style='clear:both;'></div>";
echo "</header>";
现在。这是来自一个包含文件,所以我崩溃时没有得到MySQL错误。也许代码很好,但有些东西在某个地方打破了它。它没有吐出错误或其他任何东西。它只是把div留空了。我知道它需要经过很多代码,但文件大约有560行,而且我不打算发布所有这些代码。 TY提前获得可能提供的任何帮助。甚至关于如何清理它的提示也会很棒。