is there a way that i can insert entered data from the html form in mysql table all in caps so that when my table is displayed it is all in the same format? For example how can i re-write this statement to insert data in all caps.
有没有办法,我可以插入mysql表格中的html表格中的输入数据全部大写,这样当我的表格显示时,它们都是相同的格式?例如,如何重写此语句以在所有大写字母中插入数据。
$sql2 = "INSERT INTO `area`(name, hub, fk_hub_id) VALUES ('$areaname',(SELECT `name` from hub WHERE name = '$hub'),
(SELECT `id` from hub WHERE name = '$hub'))";
1 个解决方案
#1
0
use UPPER()
INSERT INTO `area`(name, hub, fk_hub_id) VALUES (UPPER('$areaname',(SELECT UPPER(`name`) from hub WHERE name = UPPER('$hub')), (SELECT `id` from hub WHERE name = UPPER('$hub')))
#1
0
use UPPER()
INSERT INTO `area`(name, hub, fk_hub_id) VALUES (UPPER('$areaname',(SELECT UPPER(`name`) from hub WHERE name = UPPER('$hub')), (SELECT `id` from hub WHERE name = UPPER('$hub')))