我有这个网络服务
http://www.example.com/addregisteredusers.php?emailId=test@tets.com&userName=🍴🍟🍔🍕
php代码:
$emailId=$_REQUEST['emailId'];
$userName=$_REQUEST['userName'];
$insertDetails=mysql_query("INSERT INTO `registration` (`userName`, `emailId`) VALUES ('$userName', '$emailId')");
当转到数据库时,用户名字段为空。
最佳答案
我已经创建了表格,其中包含如下屏幕所示的字段
表的结构
表格中的数据
我用过这个代码。
$emailId = mysql_real_escape_string($_REQUEST['email']);
$userName = mysql_real_escape_string($_REQUEST['uname']);
mysql_query("INSERT INTO `new` (`userName`, `emailId`) VALUES ('$userName', '$emailId')") or die(mysql_error());
关于php - 使用php将符号插入mysql,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/22783920/