>백엔드 개발 >PHP 튜토리얼 > sql语法异常?

sql语法异常?

WBOY
WBOY원래의
2016-06-13 12:32:411288검색

sql语法错误??
Query failed:SQLSTATE[42000]: Syntax error or access violation: 1064 You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'FROMmembers WHERE id = 0' at line 1

<?php<br />
require_once("common.inc.php");<br />
require_once("config.php");<br />
require_once("Member.class.php");<br />
require_once("LogEntry.class.php");<br />
<br />
$memberId = isset($GET_["memberId"])?(int)$_GET("memberId"):0;<br />
<br />
if(!$memberId = Member::getMember($memberId)){<br />
	displayPageHeader("Error");<br />
	echo"<div> Member not found.</div>";<br />
	displayPageFooter();<br />
	exit;<br />
}<br />
<br />
$logEntries = LogEntry::getLogEntries($memberId);<br />
displayPageHeader("View member: ".$member->getValueEncoded("firstName")." ".$member->getValueEncoded("lastName"));<br />
<br />
?><br />
	<dl style="width: 30em;"><br />
		<dt>Username</dt><br />
		<dd><?php echo $member->getValueEncoded("username")?></dd><br />
		<dt>First name</dt><br />
		<dd><?php echo $member->getValueEncoded("firstname")?></dd><br />
		<dt>Last name</dt><br />
		<dd><?php echo $member->getValueEncoded("lastname")?></dd><br />
		<dt>Joined on</dt><br />
		<dd><?php echo $member->getValueEncoded("joinData")?></dd><br />
		<dt>Gender</dt><br />
		<dd><?php echo $member->getGenderString()?></dd><br />
		<dt>Favorite genre</dt><br />
		<dd><?php echo $member->getFavoriteGenreString()?></dd><br />
		<dt>Email address</dt><br />
		<dd><?php echo $member->getValueEncoded("emailAddress")?></dd><br />
		<dt>Other interests</dt><br />
		<dd><?php echo $member->getValueEncoded("otherInterests")?></dd><br />
	</dl><br />
	<br />
	<h2>Access log</h2><br />
	<br />
	<table cellspacing="0" style="width:30em;border:1px solid #666;"><br />
		<tr><br />
			<th>Web page</th><br />
			<th>Number of visits</th><br />
			<th>Last visit</th><br />
		</tr><br />
<?php<br />
$rowCount = 0;<br />
foreach($logEntries as $logEntry){<br />
	$rowCount++;<br />
?><br />
		<tr><?php if($rowCount%2 == 0) echo'class="alt"'?>><br />
			<td><?php echo $logEntry->getValueEncoded("pageUrl")?></td><br />
			<td><?php echo $logEntry->getValueEncoded("numVisits")?></td><br />
			<td><?php echo $logEntry->getValueEncoded("lastAccess")?></td><br />
		</tr><br />
<?php <br />
}<br />
?><br />
	</table><br />
	<br />
	<div style="width:30em;margin-top:20px;text-align:center;"><br />
		<a href="javascript:history.go(-1)">Back</a><br />
	</div><br />
	<br />
<?php<br />
displayPageFooter();<br />
?>

성명:
본 글의 내용은 네티즌들의 자발적인 기여로 작성되었으며, 저작권은 원저작자에게 있습니다. 본 사이트는 이에 상응하는 법적 책임을 지지 않습니다. 표절이나 침해가 의심되는 콘텐츠를 발견한 경우 admin@php.cn으로 문의하세요.