views
cursor = connection.cursor()
cursor.execute("select staff_name from alarm_platform.TBL_STAFF where staff_number=(select duty_staff_number1 from alarm_platform.TBL_DUTY a where duty_staff_time_start > DATE_SUB(CURDATE(), INTERVAL 0 DAY));")
alert_today = cursor.fetchone()
context_bak = {'msg': alert_list}
print(context_bak)
return render(request,"mysql_insert.html", {'msg_1': json.dumps(context_bak)})html接受数据
{{ msg_1 }}转载于:https://blog.51cto.com/13675040/2118641
本文展示了一个使用Python操作MySQL数据库的具体案例,通过SQL语句从数据库中选取当天的值班人员信息。此示例适用于那些需要定时获取特定记录并进行后续处理的应用场景。
948

被折叠的 条评论
为什么被折叠?



