Home > Backend Development > PHP Tutorial > php+js出现异常,求!

php+js出现异常,求!

WBOY
Release: 2016-06-13 13:53:14
Original
1197 people have browsed it

php+js出现错误,求高手指点!!!
我从数据库中找出来的性别数据,想在javascript中调用,老是现实说什么“男未定义”,有没有高手指点下,应该怎么改啊?
类似:
$Sex=$row["Sex"];//数据中Sex列的值

echo "<script>alert('.$Sex.')</script>";

------解决方案--------------------

探讨
我从数据库中找出来的性别数据,想在javascript中调用,老是现实说什么“男未定义”,有没有高手指点下,应该怎么改啊?
类似:
$Sex=$row["Sex"];//数据中Sex列的值

echo "<script>alert('.$Sex.')</script>";

------解决方案--------------------
如果还弹出“未定义”, 那就是你的搜索结果为空。先把执行的sql在数据库中执行一下
Related labels:
source:php.cn
Statement of this Website
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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template