1

如何以大写字母存储我的数据?

询问

$personal_date_birth = checkDateY($personal_date_birth);

mysql_query("UPDATE personal_data SET personal_full_name = '".mysql_real_escape_string($personal_full_name)."', personal_title = '".mysql_real_escape_string($personal_title)."', personal_date_birth ='".mysql_real_escape_string($personal_date_birth)."', personal_marital_status = '".mysql_real_escape_string($personal_marital_status)."', personal_nationality = '".mysql_real_escape_string($personal_nationality)."', personal_race = '".mysql_real_escape_string($personal_race)."', personal_religion = '".mysql_real_escape_string($personal_religion)."', personal_gender = '".mysql_real_escape_string($personal_gender)."', personal_country_birth = '".mysql_real_escape_string($personal_country_birth)."', personal_bumiputra_status = '".mysql_real_escape_string($personal_bumiputra_status)."' WHERE LAS_login_id = '".mysql_real_escape_string($LAS_login_id)."'")
4

5 回答 5

2

您应该像 Ankur 所说的那样在 php 中执行此操作。但是你也可以在 MySQL 中使用 UPPER('string');

于 2013-10-08T06:15:59.303 回答
2

使用strtoupper()功能

试试这个

$personal_date_birth = checkDateY($personal_date_birth); 
mysql_query("UPDATE personal_data SET 
personal_full_name='".mysql_real_escape_string(strtoupper($personal_full_name))."',
personal_title = '".mysql_real_escape_string(strtoupper($personal_title))."',
personal_date_birth ='".mysql_real_escape_string(strtoupper($personal_date_birth))."',
personal_marital_status = '".mysql_real_escape_string($personal_marital_status)."',
personal_nationality = '".mysql_real_escape_string(strtoupper($personal_nationality))."',
personal_race = '".mysql_real_escape_string(strtoupper($personal_race))."',
personal_religion = '".mysql_real_escape_string(strtoupper($personal_religion))."',
personal_gender = '".mysql_real_escape_string(strtoupper($personal_gender))."',
personal_country_birth = '".mysql_real_escape_string(strtoupper($personal_country_birth))."',
personal_bumiputra_status = '".mysql_real_escape_string(strtoupper($personal_bumiputra_status))."' 
WHERE LAS_login_id = '".mysql_real_escape_string($LAS_login_id)."'")
于 2013-10-08T06:20:38.797 回答
1

使用“strtoupper()”函数,把你想要的括号内的文本作为大写。

于 2013-10-08T06:14:10.180 回答
1

使用如下:

INSERT INTO `sample_table`(`name`) values(UPPER('new text'))
于 2013-10-08T06:14:48.283 回答
0

试试这样...

UPDATE products_description SET `products_name` = UPPER( `products_name` ) 
于 2013-10-08T06:14:39.163 回答