我想做类似的事情:
插入POST时:
<input type="text" name="name" />
<?php
$name = $_POST['name'];
$string = "M";
//code to insert $name AND $string together into database table
?>
我想在此变量前面添加一个固定字符串,我希望我的查询读起来像这样:
$name + M
让我们想象一下这个名字是乔治,我想把名字George插入数据库,用M
像这样:George M
我该怎么做?
答案 0 :(得分:1)
$name = $_POST['name'];
$string = "M";
$full_string = $name . " " . $string;
//code to insert $full_string into database table