PHP-ucword-mysql-insert

PHP-ucword-mysql-insert,php,Php,我在筛选“ondeck”插入的第一个字母时遇到问题。我正在尝试使用ucwords,但我不确定在下面的语句中该放在哪里: if ((isset($_POST["MM_insert"])) && ($_POST["MM_insert"] == "form2")) { $insertSQL = sprintf("INSERT INTO updates (windowStatus, onDeck, updateComments, username) VALUES (%s, %s, %s,

我在筛选“ondeck”插入的第一个字母时遇到问题。我正在尝试使用ucwords,但我不确定在下面的语句中该放在哪里:

if ((isset($_POST["MM_insert"])) && ($_POST["MM_insert"] == "form2")) {
$insertSQL = sprintf("INSERT INTO updates (windowStatus, onDeck, updateComments, username) VALUES (%s, %s, %s, %s)",
                   GetSQLValueString($_POST['windowStatus'], "text"),
                   GetSQLValueString($_POST['onDeck'], "text"),
                   GetSQLValueString($_POST['updateComments'], "text"),
                   GetSQLValueString($_POST['username'], "text"));

请告知。谢谢大家!

PHP的
ucfirst
将字符串的第一个字母大写。看

所以要想资本化,你可能想

GetSQLValueString(ucfirst($_POST['onDeck']), "text")
或者
ucwords
,如果你需要的话。 假设
GetSQLValueString
是某种sql注入安全性。否则,您可能需要了解SQL注入技术