我有以下使用NaviCat for MySQL很好运行的MySQL查询。
def search_item():
referencenum = input("Enter item reference:")
objects = initialize()
obj_references = [obj.reference for obj in objects]
obj_titles = [obj.title for obj in objects]
obj_ratings = [obj.rating for obj in objects]
obj_authors = [obj.author for obj in objects]
if referencenum not in obj_references:
print("No Such Object found")
else:
obj_id = obj_references.index(referencenum)
print("Title:", obj_titles[obj_id], "Rating:", obj_ratings[obj_id],
"Author:", obj_authors[obj_id])
使用WordPress,我有以下代码段。
唯一的变化是
OLD:客户端=“ user1”
TO:客户端='$ current_user-> user_login'
此外,我需要将客户端字符串替换为
SELECT COUNT(*) as count, datescanned, client FROM s1 WHERE risk
= "High" and client = "user1" AND datescanned IN (SELECT max(datescanned) FROM
s1)
但是,我似乎无法使其正常工作。用引号``有问题吗?
任何反馈将不胜感激。
Thx 娜塔莉(Nathalie)