I'm getting the error:
我得到错误:
#1064 - 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 ' dag = zaterdag, start = 15, start_minuten = 00, eind = 19, eind_minuten = 00, d' at line 1
#1064 -在SQL语法中有一个错误;检查与MySQL服务器版本对应的手册,找到正确的语法,在第1行使用' dag = zaterdag, start = 15, start_minuten = 00, eind = 19, eind_minuten = 00, d'
when I try to run this query in Phpmyadmin:
当我尝试在phpadmin myadmin运行这个查询时:
SELECT * FROM rooster WHERE medewerker = 00126311, dag = zaterdag, start = 15, start_minuten = 00, eind = 19, eind_minuten = 00, datum = 2016-09-17, weeknummer = 37, leiding = 0
SELECT * FROM rooster, medewerker = 00126311, dag = zaterdag, start = 15, start_minuten = 00, eind = 19, eind_minuten = 00, datum = 2016-09-17, weeknummer = 37, leiding = 0。
My table (rooster) structure:
我的表(公鸡)结构:
id int(4)
medewerker varchar(10)
dag varchar(10)
start varchar(25)
start_minuten varchar(25)
eind varchar(25)
eind_minuten varchar(25)
datum date
weeknummer int(2)
leiding int(1)
medewerker is inner joined with another table, it shows the employee's number.
medewerker与另一个表内部连接,它显示员工的编号。
translation: zaterdag means saturday medewerker means employee dag means day minuten means minutes datum means date weeknummer mean weeknumber leiding means boss (if boss is 1, he's the boss on that day)
zaterdag的意思是星期六medewerker的意思是雇员dag的意思是一天,分钟,数据,日期,日期,周末,周末,周末,周末,娱乐,老板(如果老板1岁,他就是那天的老板)
I will appreciate it if someone could help me with this problem.
如果有人能帮我解决这个问题,我会很感激的。
2 个解决方案
#1
2
Can you please try with this: you also have to enclose values in single quotes if datatype is VARCHAR or CHAR
如果数据类型是VARCHAR或CHAR,您还必须将值括在单引号中吗
SELECT *
FROM rooster
WHERE medewerker = '00126311'
AND dag = 'zaterdag'
AND start = '15'
AND start_minuten = '00'
AND eind = '19'
AND eind_minuten = '00'
AND datum = '2016-09-17'
AND weeknummer = 37
AND leiding = 0
#2
2
TripleDeal - in your WHERE clause, use AND operator instead of comma's
在WHERE子句中,用和运算符代替逗号
#1
2
Can you please try with this: you also have to enclose values in single quotes if datatype is VARCHAR or CHAR
如果数据类型是VARCHAR或CHAR,您还必须将值括在单引号中吗
SELECT *
FROM rooster
WHERE medewerker = '00126311'
AND dag = 'zaterdag'
AND start = '15'
AND start_minuten = '00'
AND eind = '19'
AND eind_minuten = '00'
AND datum = '2016-09-17'
AND weeknummer = 37
AND leiding = 0
#2
2
TripleDeal - in your WHERE clause, use AND operator instead of comma's
在WHERE子句中,用和运算符代替逗号