“显示票证错误Sql”为什么会发生这种情况?

时间:2018-12-04 07:07:26

标签: mysql

       	<?php
	
	include("Connection.php");
	include("ValidateStaffMessage.php");
	
	
	//getting values
	$ticketID = $_GET['id'];


	
	//select ticket with that id and referred staff email
	$sql_sel = "
SELECT * 
  FROM ticket 
 WHERE referedstaff2 LIKE '%$id%' 
    OR referedstaff1 LIKE '%$id%' 
    OR referedstaff3 LIKE '%$id%' 
    OR referedstaff4 LIKE '%$id%' 
   AND ticketid = '$ticketID'
 ";

	
	$query_sel = mysqli_query($connection, $sql_sel) or die ("Error in Display Ticket Sql." .mysqli_error($connection));
	
	if($query_sel)
	{
		echo "<h3 class=ta__center> Ticket Details: $ticketID </h3>";
	    echo "<div class=ta__left><a href=ReferTicket.php><img src=css/images/back.png></a></div><p>&nbsp;</p>";
			
			
			while($fetch = mysqli_fetch_array($query_sel))
	      {
			  $ticketID 		= $fetch[1];
			  $name 			= $fetch[2];
			  $email 			= $fetch[3];
			  $location 		= $fetch[4];
			  $category 		= $fetch[6];
			  $subject 			= $fetch[7];
			  $summary 			= $fetch[8];
			  $status 			= $fetch[9];
			  $dateCreated 		= $fetch[10];
			  $dateClosed 		= $fetch[11];

			  $referedstaff1 	= $fetch[16];
			  $referedstaff2 	= $fetch[17];
			  $referedstaff3 	= $fetch[18];
			  $referedstaff4 	= $fetch[19];

			  $assignedTo 		= $fetch[13];
			  $progress 		= $fetch[14];
			
			date_default_timezone_set("Asia/Kuala_Lumpur");
			$displayTimeCreate = date("d/m/Y, g:i:s A",$dateCreated);
			$displayTimeClosed = date("d/m/Y, g:i:s A",$dateClosed);
		  }
	}
	else
	echo "Display Failed.";	     
	?>

,并且此错误不断出现。不知道怎么了

“显示票证Sql中的错误。您的SQL语法有错误;请查看与您的MariaDB服务器版本相对应的手册,以获取在第1行的“ SF000023'”附近使用正确的语法”

0 个答案:

没有答案