我有这个web服务
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')");当转到数据库时,userName字段为空。
发布于 2014-04-01 19:06:24
我已经创建了带有如下屏幕字段的表格
表的结构

表中的数据

我已经用过这个代码了。
$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());发布于 2014-04-01 19:58:14
我通过将表和字段字符集从utf8改为utf8mb4解决了这个问题
发布于 2014-04-01 19:04:53
请运行此程序
$insertDetails = mysql_query("INSERT INTO `registration` (`userName`, `emailId`) VALUES ('".$userName."', '".$emailId."')");https://stackoverflow.com/questions/22783920
复制相似问题