php-为什么我的查询不起作用?

php-为什么我的查询不起作用?,php,mysql,Php,Mysql,我刚刚创建了一个.php文件,不幸的是,我的sql查询在我的web主机上不起作用,但是.php文件工作得很好。所以问题是,我的sql查询无法执行 它说: Post GAGAAL或Post失败(英语) 你能告诉我为什么我有一个sql错误以及如何修复这个错误吗 这是我的php代码 date\u default\u timezone\u set(“亚洲/曼谷”); ob_start(); 会话_start(); 需要'connection.php'; //如果未设置会话,则将重定向到登录页面 如果(!

我刚刚创建了一个.php文件,不幸的是,我的sql查询在我的web主机上不起作用,但是.php文件工作得很好。所以问题是,我的sql查询无法执行

它说:

Post GAGAAL或Post失败(英语)

你能告诉我为什么我有一个sql错误以及如何修复这个错误吗

这是我的php代码

date\u default\u timezone\u set(“亚洲/曼谷”);
ob_start();
会话_start();
需要'connection.php';
//如果未设置会话,则将重定向到登录页面
如果(!isset($\u会话['user'])){
标题(“位置:loginpanel.php”);
出口
}
//选择LoggedInUsersDetail
$res=mysqli_query($conn,“从akun_admin中选择*,其中idadmin=“.$”会话['user']);
$userRow=mysqli\u fetch\u数组($res);
如果(isset($_POST['btn-POST'])){
$error=false;
//清除用户输入以防止sql注入
$jd=修剪($_POST['jd']);
$jd=带标签($jd);
$sa=修剪($_POST['sa']);
$sa=带标签($sa);
$note=修剪($_POST['note']);
$note=带标签($note);
$GREEN=修剪($_POST['GREEN']);
$GREEN=strip_标签($GREEN);
$ps=修剪($_POST['ps']);
$ps=带标签($ps);
$ep14=修剪($_POST['1Link480p']);
$ep17=修剪($_POST['1Link720p']);
$ep1=修剪($ep14.'-'.$ep17);
$ep1=带标签($ep1);
$ep24=修剪($_POST['2Link480p']);
$ep27=修剪($_POST['2Link720p']);
$ep2=修剪($ep24.'-'.$ep27);
$ep2=带标签($ep2);
$ep34=修剪($_POST['3Link480p']);
$ep37=修剪($_POST['3Link720p']);
$ep3=修剪($ep34.'-'.$ep37);
$ep3=带标签($ep3);
$ep44=修剪($_POST['4Link480p']);
$ep47=修剪($_POST['4Link720p']);
$ep4=修剪($ep44.'-'.$ep47);
$ep4=带标签($ep4);
$ep54=修剪($_POST['5Link480p']);
$ep57=修剪($_POST['5Link720p']);
$ep5=修剪($ep54.'-'.$ep57);
$ep5=带标签($ep5);
$ep64=修剪($_POST['6Link480p']);
$ep67=修剪($_POST['6Link720p']);
$ep6=修剪($ep64.'-'.$ep67);
$ep6=带标签($ep6);
$ep74=修剪($_POST['7Link480p']);
$ep77=修剪($_POST['7Link720p']);
$ep7=修剪($ep74.'-'.$ep77);
$ep7=带标签($ep7);
$ep84=修剪($_POST['8Link480p']);
$ep87=修剪($_POST['8Link720p']);
$ep8=修剪($ep84.'-'.$ep87);
$ep8=带标签($ep8);
$ep94=修剪($_POST['9Link480p']);
$ep97=修剪($_POST['9Link720p']);
$ep9=修剪($ep94.'-'.$ep97);
$ep9=带标签($ep9);
$ep104=修剪($_POST['10Link480p']);
$ep107=修剪($_POST['10Link720p']);
$ep10=修剪($ep104.-'.$ep107);
$ep10=带标签($ep10);
$ep114=修剪($_POST['11Link480p']);
$ep117=修剪($_POST['11Link720p']);
$ep11=修剪($ep114.'-'.$ep117);
$ep11=带标签($ep11);
$ep124=修剪($_POST['12Link480p']);
$ep127=修剪($_POST['12Link720p']);
$ep12=修剪($ep124.-'.$ep127);
$ep12=带标签($ep12);
$ep134=修剪($_POST['13Link480p']);
$ep137=修剪($_POST['13Link720p']);
$ep13=修剪($ep134.'-'.$ep137);
$ep13=带标签($ep13);
$ep144=修剪($_POST['14Link480p']);
$ep147=修剪($_POST['14Link720p']);
$ep14=修剪($ep144.-'.$ep147);
$ep14=带标签($ep14);
$ep154=修剪($_POST['15Link480p']);
$ep157=修剪($_POST['15Link720p']);
$ep15=修剪($ep154.'-'.$ep157);
$ep15=带标签($ep15);
$ep164=修剪($_POST['16Link480p']);
$ep167=修剪($_POST['16Link720p']);
$ep16=修剪($ep164.'-'.$ep167);
$ep16=带标签($ep16);
$ep174=修剪($_POST['17Link480p']);
$ep177=修剪($_POST['17Link720p']);
$ep17=修剪($ep174.'-'.$ep177);
$ep17=带标签($ep17);
$ep184=修剪($_POST['18Link480p']);
$ep187=修剪($_POST['18Link720p']);
$ep18=修剪($ep184.'-'.$ep187);
$ep18=带标签($ep18);
$ep194=修剪($_POST['19Link480p']);
$ep197=修剪($_POST['19Link720p']);
$ep19=修剪($ep194.'-'.$ep197);
$ep19=带标签($ep19);
$ep204=修剪($_POST['20Link480p']);
$ep207=修剪($_POST['20Link720p']);
$ep20=修剪($ep204.-'.$ep207);
$ep20=带标签($ep20);
$ep214=修剪($_POST['21Link480p']);
$ep217=修剪($_POST['21Link720p']);
$ep21=修剪($ep214.'-'.$ep217);
$ep21=带标签($ep21);
$ep224=修剪($_POST['22Link480p']);
$ep227=修剪($_POST['22Link720p']);
$ep22=修剪($ep224.'-'.$ep227);
$ep22=带标签($ep22);
$ep234=修剪($_POST['23Link480p']);
$ep237=修剪($_POST['23Link720p']);
$ep23=修剪($ep234.-'.$ep237);
$ep23=带标签($ep23);
$ep244=修剪($_POST['24Link480p']);
$ep247=修剪($_POST['24Link720p']);
$ep24=修剪($ep244.-'.$ep247);
$ep24=带标签($ep24);
$tp=dat
                        date_default_timezone_set("Asia/Bangkok");
            ob_start();
             session_start();
            require 'connection.php';

             // if session is not set this will redirect to login page
             if( !isset($_SESSION['user']) ) {
              header("Location: loginpanel.php");
              exit;
             }
             // select loggedin users detail
             $res=mysqli_query($conn,"SELECT * FROM akun_admin WHERE idadmin=".$_SESSION['user']);
             $userRow=mysqli_fetch_array($res);

            if ( isset($_POST['btn-post']) ) {
                $error = false;
              // clean user inputs to prevent sql injections
              $jd = trim($_POST['jd']);
              $jd = strip_tags($jd);

              $sa = trim($_POST['sa']);
              $sa = strip_tags($sa);

              $note = trim($_POST['note']);
              $note = strip_tags($note);

              $genre = trim($_POST['genre']);
              $genre = strip_tags($genre);

              $ps = trim($_POST['ps']);
              $ps = strip_tags($ps);

              $ep14 = trim($_POST['1Link480p']);
              $ep17 = trim($_POST['1Link720p']);
              $ep1 = trim($ep14.'-'.$ep17);
              $ep1 = strip_tags($ep1);

              $ep24 = trim($_POST['2Link480p']);
              $ep27 = trim($_POST['2Link720p']);
              $ep2 = trim($ep24.'-'.$ep27);
              $ep2 = strip_tags($ep2);

              $ep34 = trim($_POST['3Link480p']);
              $ep37 = trim($_POST['3Link720p']);
              $ep3 = trim($ep34.'-'.$ep37);
              $ep3 = strip_tags($ep3);

              $ep44 = trim($_POST['4Link480p']);
              $ep47 = trim($_POST['4Link720p']);
              $ep4 = trim($ep44.'-'.$ep47);
              $ep4 = strip_tags($ep4);  

              $ep54 = trim($_POST['5Link480p']);
              $ep57 = trim($_POST['5Link720p']);
              $ep5 = trim($ep54.'-'.$ep57);
              $ep5 = strip_tags($ep5);

              $ep64 = trim($_POST['6Link480p']);
              $ep67 = trim($_POST['6Link720p']);
              $ep6 = trim($ep64.'-'.$ep67);
              $ep6 = strip_tags($ep6);

              $ep74 = trim($_POST['7Link480p']);
              $ep77 = trim($_POST['7Link720p']);
              $ep7 = trim($ep74.'-'.$ep77);
              $ep7 = strip_tags($ep7);

              $ep84 = trim($_POST['8Link480p']);
              $ep87 = trim($_POST['8Link720p']);
              $ep8 = trim($ep84.'-'.$ep87);
              $ep8 = strip_tags($ep8);

              $ep94 = trim($_POST['9Link480p']);
              $ep97 = trim($_POST['9Link720p']);
              $ep9 = trim($ep94.'-'.$ep97);
              $ep9 = strip_tags($ep9);

              $ep104 = trim($_POST['10Link480p']);
              $ep107 = trim($_POST['10Link720p']);
              $ep10 = trim($ep104.'-'.$ep107);
              $ep10 = strip_tags($ep10);

              $ep114 = trim($_POST['11Link480p']);
              $ep117 = trim($_POST['11Link720p']);
              $ep11 = trim($ep114.'-'.$ep117);
              $ep11 = strip_tags($ep11);

              $ep124 = trim($_POST['12Link480p']);
              $ep127 = trim($_POST['12Link720p']);
              $ep12 = trim($ep124.'-'.$ep127);
              $ep12 = strip_tags($ep12);

              $ep134 = trim($_POST['13Link480p']);
              $ep137 = trim($_POST['13Link720p']);
              $ep13 = trim($ep134.'-'.$ep137);
              $ep13 = strip_tags($ep13);

              $ep144 = trim($_POST['14Link480p']);
              $ep147 = trim($_POST['14Link720p']);
              $ep14 = trim($ep144.'-'.$ep147);
              $ep14 = strip_tags($ep14);

              $ep154 = trim($_POST['15Link480p']);
              $ep157 = trim($_POST['15Link720p']);
              $ep15 = trim($ep154.'-'.$ep157);
              $ep15 = strip_tags($ep15);

              $ep164 = trim($_POST['16Link480p']);
              $ep167 = trim($_POST['16Link720p']);
              $ep16 = trim($ep164.'-'.$ep167);
              $ep16 = strip_tags($ep16);

              $ep174 = trim($_POST['17Link480p']);
              $ep177 = trim($_POST['17Link720p']);
              $ep17 = trim($ep174.'-'.$ep177);
              $ep17 = strip_tags($ep17);

              $ep184 = trim($_POST['18Link480p']);
              $ep187 = trim($_POST['18Link720p']);
              $ep18 = trim($ep184.'-'.$ep187);
              $ep18 = strip_tags($ep18);

              $ep194 = trim($_POST['19Link480p']);
              $ep197 = trim($_POST['19Link720p']);
              $ep19 = trim($ep194.'-'.$ep197);
              $ep19 = strip_tags($ep19);

              $ep204 = trim($_POST['20Link480p']);
              $ep207 = trim($_POST['20Link720p']);
              $ep20 = trim($ep204.'-'.$ep207);
              $ep20 = strip_tags($ep20);

              $ep214 = trim($_POST['21Link480p']);
              $ep217 = trim($_POST['21Link720p']);
              $ep21 = trim($ep214.'-'.$ep217);
              $ep21 = strip_tags($ep21);

              $ep224 = trim($_POST['22Link480p']);
              $ep227 = trim($_POST['22Link720p']);
              $ep22 = trim($ep224.'-'.$ep227);
              $ep22 = strip_tags($ep22);   

              $ep234 = trim($_POST['23Link480p']);
              $ep237 = trim($_POST['23Link720p']);
              $ep23 = trim($ep234.'-'.$ep237);
              $ep23 = strip_tags($ep23);

              $ep244 = trim($_POST['24Link480p']);
              $ep247 = trim($_POST['24Link720p']);
              $ep24 = trim($ep244.'-'.$ep247);
              $ep24 = strip_tags($ep24);

              $tp = date("Y-m-d");
              $wp = date("h:i:sa");

              $ap = $userRow['alias'];

            function generateRandomString($length = 50) {
                $characters = '0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ';
                $charactersLength = strlen($characters);
                $randomString = '';
                for ($i = 0; $i < $length; $i++) {
                    $randomString .= $characters[rand(0, $charactersLength - 1)];
                }
                return $randomString;
            }
              $postID = generateRandomString();
              // if there's no error, continue to signup
              if(!empty($jd)) {
               $res = mysqli_query($conn,"INSERT INTO postperepisode1_12 (idpost, judulpost, tanggal, waktu, adminposting, genre, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 1`, 18, 19, 20, 21, 22, 23, 24, note, sinopsis) VALUES ('$postID', '$jd', '$tp', '$wp', '$ap', '$genre', '$ep1', '$ep2', '$ep3', '$ep4', '$ep5', '$ep6', '$ep7', '$ep8', '$ep9', '$ep10', '$ep11', '$ep12', '$ep13', '$ep14', '$ep15', '$ep16', '$ep17', '$ep18', '$ep19', '$ep20', '$ep21', '$ep22', '$ep23', '$ep24', '$sa', '$note')");

               if ($res) {
                $errTyp = "success";
                $errMSG = "Posting Berhasil";
               } else {
                $errTyp = "danger";
                $errMSG = "Post Gagal"; 
               } 

              }


             }
            ?>