Home > Backend Development > PHP Tutorial > sql语法异常?

sql语法异常?

WBOY
Release: 2016-06-13 12:32:41
Original
1272 people have browsed it

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 />
?>
Copy after login

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