SQL syntax exception?

Source: Internet
Author: User
Tags logentries
SQL syntax error ?? Query & nbsp; failed: SQLSTATE [42000]: & nbsp; Syntax & nbsp; error & nbsp; or & nbsp; access & nbsp; violation: & nbsp; 1064 & nbsp; you SQL syntax error ??
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
 require_once("common.inc.php");
require_once("config.php");
require_once("Member.class.php");
require_once("LogEntry.class.php");

$memberId = isset($GET_["memberId"])?(int)$_GET("memberId"):0;

if(!$memberId = Member::getMember($memberId)){
displayPageHeader("Error");
echo" Member not found.";
displayPageFooter();
exit;
}

$logEntries = LogEntry::getLogEntries($memberId);
displayPageHeader("View member: ".$member->getValueEncoded("firstName")." ".$member->getValueEncoded("lastName"));

?>

Username

getValueEncoded("username")?>

First name

getValueEncoded("firstname")?>

Last name

getValueEncoded("lastname")?>

Joined on

getValueEncoded("joinData")?>

Gender

getGenderString()?>

Favorite genre

getFavoriteGenreString()?>

Email address

getValueEncoded("emailAddress")?>

Other interests

getValueEncoded("otherInterests")?>



Access log



Web page
Number of visits
Last visit

$rowCount = 0;
foreach($logEntries as $logEntry){
$rowCount++;
?>
>
getValueEncoded("pageUrl")?>
getValueEncoded("numVisits")?>
getValueEncoded("lastAccess")?>

}
?>



Back


displayPageFooter();
?>
Share:
------ Solution --------------------
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

The basic format of the select command is
SELECT field list FROM table name

How can the SQL command parser recognize FROM and members when you stick them together?


------ Solution --------------------
Is to let you write separately, otherwise the FROM keyword cannot be identified.
------ Solution --------------------
Check whether the Member data table exists.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.