Home > Backend Development > PHP Tutorial > 学习PHP遇到一个语法有关问题,折腾一天了,

学习PHP遇到一个语法有关问题,折腾一天了,

WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWB
Release: 2016-06-13 12:12:24
Original
891 people have browsed it

学习PHP遇到一个语法问题,折腾一天了,求助。

本帖最后由 a858070363 于 2014-12-23 18:21:04 编辑 PHP代码部份,问题就出在这里,不能正常的做判断。

<br />            <?php<br />             if(sysname("webstate") == "Y"){//这里是sysname函数<br />			  echo '<option value="Y">开启中</option>';<br />              echo '<option value="N">停止中</option>';<br />				}else{<br />			  echo '<option value="N">停止中</option>';<br />			  echo '<option value="Y">开启中</option>';<br />			   }<br />			?><br />
Copy after login


函数部份:
<br />//网站基本信息,根据字段获取内容<br />function sysname($field){ <br />$sql="select * from system"; <br />$query=mysql_query($sql); <br />$rs=mysql_fetch_array($query); <br />echo $rs["$field"];<br />}<br />
Copy after login


数据库里webstate字段用的是char类型  字段用函数都可以正常输出,就是不能做判断。


求助。
------解决思路----------------------
不好意思,手误!
retrun
应为
return
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