[英]Which SQL command should I use to organise upper case and lower case?
例如, 文章表下的當前標題值是:
我必須將首字符更改為大寫,然后將后續字符更改為小寫。
交易后,它們應如下所示:
我應該使用哪個SQL命令通過MySQL查詢更改標題的所有數據並永久更改它們?
顯然,這可行:
CONCAT(UPPER(SUBSTRING(title, 1, 1)),LOWER(SUBSTRING(title, 2)))
使用ucfirst();
PHP中的功能。 首先,將其檢索到變量中,然后將其傳遞給ucfirst();
功能並回顯答案。
<?php
$foo = 'hello world!';
$foo = ucfirst($foo); // Hello world!
$bar = 'HELLO WORLD!';
$bar = ucfirst($bar); // HELLO WORLD!
$bar = ucfirst(strtolower($bar)); // Hello world!
?>
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.