判断数据库内容,在页面显示自定义数据 case when...then ...else...end 比如:数据库内容是这样: 通过sql语句判断,数据库的name字段,内容是月桂的,显示嫦娥,其他的显示玉兔 select case when name='月桂' then '嫦娥' else '玉兔' end as name from jy_dic_crop t 参考: http://www.cnblogs.com/yazdao/archive/2009/12/09/1620482.html
django使用mysql数据库: 首先cmd创建库 1.settings: """Django settings for day42 project. Generated by 'django-admin startproject' using Django 1.11.26. For more information on this file, seehttps://docs.djangoproject.com/en/1.11/topics/settings/ For th