第七色在线视频,2021少妇久久久久久久久久,亚洲欧洲精品成人久久av18,亚洲国产精品特色大片观看完整版,孙宇晨将参加特朗普的晚宴

為了賬號(hào)安全,請(qǐng)及時(shí)綁定郵箱和手機(jī)立即綁定
已解決430363個(gè)問(wèn)題,去搜搜看,總會(huì)有你想問(wèn)的

查詢解決方案

查詢解決方案

PHP
函數(shù)式編程 2022-08-19 15:40:42
我在啟動(dòng)項(xiàng)目時(shí)遇到查詢問(wèn)題。它說(shuō)解析錯(cuò)誤:語(yǔ)法錯(cuò)誤,C:\Users\ahmed\Documents\zadacaveb\Call Center\Dateof_seminars\forma.php第 34 行中出現(xiàn)意外的“$sql”(T_VARIABLE)當(dāng)我按下按鈕 Dodaj (engl.添加)。我沒(méi)有看到我的查詢有問(wèn)題,所以如果你看到我的查詢中哪里有錯(cuò)誤,請(qǐng)告訴我。我將展示我的forma代碼.php這是一個(gè)問(wèn)題,以及來(lái)自文件索引.php和刪除.php的代碼。這兩個(gè)文檔工作正常,但問(wèn)題是形式上的.php索引.php<?phprequire('../util/session.php');require('../util/db.php');require('../Frontend/header.php');require('../Frontend/footer.php');if(!isset($_SESSION['user'])) {    header('Location: /Call Center/Login/index.php');}$stmt = $db->query('SELECT * FROM dateof_seminars');$rows = $stmt->fetchAll();echo $header;?><br/><br/><div class="container">    <a href="/Call Center/Dateof_seminars/forma.php" class="btn btn-primary mt-3 mb-3 float-left">Dodaj</a>    <br/>    <br/>    <table class="table">      <thead>        <tr>          <th scope="col">#</th>          <th scope="col">Po?inje datuma</th>          <th scope="col">Zavr?ava datumom</th>          <th scope="col">Instruktor ID</th>          <th scope="col">Seminar ID</th>          <th scope="col">Klijent ID</th>        </tr>      </thead>      <tbody>        <?php foreach($rows as $row) { ?>      <tr>          <th scope="row"><?php echo $row['id']; ?></th>          <td><?php echo $row['date_from']; ?></td>          <td><?php echo $row['date_to']; ?></td>          <td><?php echo $row['instructor_id']; ?></td>          <td><?php echo $row['seminars_id']; ?></td>          <td><?php echo $row['clients_id']; ?></td>          <td>          <a class="btn btn-primary" href="/Call Center/Dateof_seminars/forma.php?id=<?php echo $row['id']; ?>">Edit</a>          <a class="btn btn-danger" href="/Call Center/Dateof_seminars/delete.php?id=<?php echo $row['id']; ?>">Delete</a>        </tr>        <?php } ?>      </tbody>    </table>    </center></div><?phpecho $footer;?> 
查看完整描述

2 回答

?
開(kāi)心每一天1111

TA貢獻(xiàn)1836條經(jīng)驗(yàn) 獲得超13個(gè)贊

您在一行上缺少一個(gè)分號(hào),即:


$dateFrom = $_POST['date_from'];

$dateTo = $_POST['date_to'];

$instructorId = $_POST['instructor_id'];

$seminarsId = $_POST['seminars_id'];

$clientsId = $_POST['clients_id']  <----


$sql = 'INSERT INTO dateof_seminars (date_from, date_to, instructor_id, seminars_id, clients_id) VALUES (:date_from, :date_to, :instructor_id, :seminars_id, :clients_id)';

$stmt = $db->prepare($sql);

因此,下一行是出乎意料的,編譯器不知道該如何處理它。$sql


查看完整回答
反對(duì) 回復(fù) 2022-08-19
?
楊魅力

TA貢獻(xiàn)1811條經(jīng)驗(yàn) 獲得超6個(gè)贊

在提到的第34行(這個(gè):$sql = 'INSERT INTO dateof_seminars (date_from, date_to, instructor_id, seminars_id, clients_id) VALUES (:date_from, :date_to, :instructor_id, :seminars_id, :clients_id)'; )

你必須用雙引號(hào)替換單引號(hào),就像這樣

$sql = "INSERT INTO dateof_seminars (date_from, date_to, instructor_id, seminars_id, clients_id) VALUES (:date_from, :date_to, :instructor_id, :seminars_id, :clients_id)";

據(jù)我所知,你不能在單引號(hào)中使用變量。


查看完整回答
反對(duì) 回復(fù) 2022-08-19
  • 2 回答
  • 0 關(guān)注
  • 129 瀏覽

添加回答

舉報(bào)

0/150
提交
取消
微信客服

購(gòu)課補(bǔ)貼
聯(lián)系客服咨詢優(yōu)惠詳情

幫助反饋 APP下載

慕課網(wǎng)APP
您的移動(dòng)學(xué)習(xí)伙伴

公眾號(hào)

掃描二維碼
關(guān)注慕課網(wǎng)微信公眾號(hào)