数据库在修改进程文件后突然没有响应

时间:2010-06-23 03:45:06

标签: php mysql

我有一个问题,我的数据库变得没有响应..我正在使用一个页面进程为许多形式..正常时它可以正常工作,我的错在哪里:

switch(postVar('action')) {
        case 'newinputdata' : newinputdata(postVar('modelnm'),postVar('serialno'),postVar('faline'),postVar('shift'),postVar('insp_date'),postVar('range_sampl'),postVar('pack'),post$
                break;
}

和查询:

function newinputdata($modelnm,$serialno,$faline,$shift,$insp_date,$range_sampl,$pack,$acc,$app,$tuner_rng,$gen,$remark,$NIK,$time) {

        $Model=mysql_real_escape_string($modelnm);
        $Serial_number=mysql_real_escape_string($serialno);
        $Line=mysql_real_escape_string($faline);
        $Shift=mysql_real_escape_string($shift);
        $Inspection_date=mysql_real_escape_string($insp_date);
        $Range_sampling=mysql_real_escape_string($range_sampl);
        $Packing=mysql_real_escape_string($pack);
        $Accesories=mysql_real_escape_string($acc);
        $Appearance=mysql_real_escape_string($app);
        $Tuner=mysql_real_escape_string($tuner_rng);
        $General_operation=mysql_real_escape_string($gen);
        $Remark=mysql_real_escape_string($remark);
        $NIK=mysql_real_escape_string($NIK);
        $Time_inspection=mysql_real_escape_string($time);


//build query


     $sql = "INSERT INTO inspection_report ";
      $sql.= "(Model,       Serial_number,       Line,        Shift,     Inspection_datetime,         Range_sampling,       Packing, ";
      $sql.= "Accesories,       Appearance,      Tuner,        General_operation,       Remark, ";
      $sql.= "NIK, Time_inspection) ";
      $sql.= "VALUES ('";
      $sql.= $Model."','".$Serial_number."', '".$Line."','".$Shift."','".postVar('insp_date')." ".postVar('time')."','".$Range_sampling."','".$Packing."','";
      $sql.= $Accesories."','".$Appearance."','".$Tuner."','".$General_operation."','".$Remark."','";
      $sql.= $NIK."','".$Time_inspection."')";
    $result=mysql_query($sql,$dbc) or die(_ERROR26.": ".mysql_error());
echo $result;
mysql_close($dbc);
}

1 个答案:

答案 0 :(得分:0)

我发现了一个傻逼的问题......在我的程序运行正常后,我只是做了一点改变:

$result=mysql_query($sql) or die(_ERROR26.": ".mysql_error());
//echo $result;
mysql_close($dbc);
}