$sql="insert into message (id,name,email,phone,qq,message) ".
"values(NULL,'".$_POST["name"]."','".$_POST["email"]."','".$_POST["phone"]."','".$_POST["qq"]."','".$_POST["message"]."')";  
mysql_query($sql)or die(mysql_error());

解决方案 »

  1.   

    参考:function turnInfor($infor, $href) {
    global $webpost;
    echo "<meta http-equiv='Content-Type' content='text/html; charset=utf-8' />" .
    "<script type='text/javascript' language='javascript'>" .
    "alert('{$infor}');" .
    "if('{$href}'){" .
    " window.location.href='{$href}';" .
    "} else{
    history.back();
    }" .
    "</script>";
    exit;
    }
    $sql = "SELECT LOG_ID,MACHINE_NAME,LOG_TYPE,LOG_DATE,LOG_DESC FROM logex;";
    $result = mysql_query($sql, $connect);
    if (mysql_affected_rows() > 0) {
    $logs = array ();
    while ($logInfor = mysql_fetch_array($result, MYSQL_ASSOC)) {
    array_push($logs, $logInfor);
    }
    } else {
    turnInfor('日志查询失败');
    exit;
    }