you have an error in your sql syntax มันเป็นอะไรครับช่วยดูให้หน่อยครับ
Error
You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ' order, (informant,id_branch,id_department,tel,date_informant,id_category,sympto' at line 1
Code (PHP)
<?php
$dbserver = 'localhost';
$dbuser = 'root' ;
$dbpass= "admin";
$dbname= 'service';
$homepage_url = '/service/index.php';
define('TTF_DIR',dirname(__FILE__).'/scripts/');
error_reporting(E_ALL ^ E_NOTICE);
ob_start();
session_start();
mysql_connect($dbserver, $dbuser, $dbpass) or die("ไม่สามารถเชื่อมต่อดาต้าเบสได้");
mysql_select_db($dbname) or die("ไม่สามารถเชื่อมต่อดาต้าเบสได้");
mysql_query("SET NAMES UTF8");
require_once 'functions.php';
require_once 'scripts/Pager.php';
$departments = tb('tbl_department','id_department','name_department');
$branches = tb('tbl_branch','id_branch','code_branch');
$branches_names = tb('tbl_branch','id_branch','name_branch');
$categories = tb('tbl_category','id_category','name_category');
$repairstatus = tb('tbl_status_servicerepair','id_status','name_status');
$officers = tb('tbl_officer','id_officer','name_officer');
$officer_tels = tb('tbl_officer','id_officer','tel_officer');
$memberstatus = tb('tbl_statusmember','id_statusmember','name_statusmember');
$customers = tb('tbl_customers','id_customers','name_customers','code_branch');
//................ ตรวจสอบสิทธิ
$uri = str_replace('/','',basename($_SERVER['SCRIPT_NAME']));
$statusmember = @$_SESSION['id_statusmember'];
define('ADMIN',1);
define('OFFICER',2);
$sname = statusmember_name($statusmember);
$publics = array(
'repair-detail.php',
'repair-insert.php',
'repair-report.php',
'index.php',
'login.php',
'index-top.php',
'index-left.php',
'index-right.php',
'index-bottom.php'
);
if ($statusmember != ADMIN
&& strpos($uri,'-'.$sname.'-') === false
&& !in_array($uri,$publics,true)
){
header('Content-type:text/html;charset=utf-8');
echo '<script type="text/javascript">';
echo 'alert("คุณไม่สามารถเข้าใช้หน้านี้ได้ กรุณา login เข้าสู่ระบบ");';
echo 'window.history.back();';
echo '</script>';
}
?>
Tag : PHP
Date :
2013-09-16 14:04:24
By :
lata
View :
758
Reply :
3
You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ' order, (informant,id_branch,id_department,tel,date_informant,id_category,sympto' at line 1
คำสั่ง SQL ผิดครับ
Date :
2013-09-16 14:11:14
By :
arm8957
ผมต้องแก้ไขอย่างไงครับ
Date :
2013-09-16 14:47:18
By :
lata
น่าจะเป็นตัวนี้แหละครับ ลองใส่ซิงเกิลโค้ด (') ครอบค่าทั้งหมดดูครับ
$data = mysql::values(
'informant', 'id_branch', 'id_department',
'tel', 'date_informant', 'id_category', 'symptoms', 'id_status', 'id_customers', 'order'
);
Date :
2013-09-16 15:32:27
By :
arm8957
Load balance : Server 00