Home >Database >Mysql Tutorial >javascript-PHP写入mysql时的问题

javascript-PHP写入mysql时的问题

WBOY
WBOYOriginal
2016-06-06 09:41:171182browse

mysqljavascriptphp

<code> <?php $conn=mysql_connect("localhost","root","") or die("数据库服务器连接错误".mysql_error());           mysql_select_db("hanoi",$conn) or die("数据库访问错误".mysql_error());           mysql_query("set character set gb2312");           mysql_query("set names gb2312");$n = "<script>document.write(name);";$s = "<script>document.write(s);</script>";echo "$name  $score";mysql_query("insert into rank (name,socre) values ('$n','$s')",$conn);?></code>

现在需要从JavaScript提取两个变量 存在mysql里面
但是 存储之后的结果是这样的:
怎么正确导入我需要的数据呢
图片说明

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn