PHP PDO,解析错误:语法错误,意外的 $end [英] PHP PDO, Parse error: syntax error, unexpected $end

查看:39
本文介绍了PHP PDO,解析错误:语法错误,意外的 $end的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我是使用 php 和 PDO 的新手.我正在尝试使用会话从数据库接收数据.我目前收到以下错误:解析错误:语法错误,意外的 $end in/home/atlismap/public_html/profile.php 163 行

Hi I am new to using php and PDO.I am trying to receive data form a data base using sessions. I am currently getting the following error: Parse error: syntax error, unexpected $end in /home/atlismap/public_html/profile.php on line 163

 <?php

 require_once 'check.php';

  $full_name = "";
  // IF CONDITION TO IS TRUE LOCAL VARIBALES WILL BE CREATED FOR THE SESSION.
   if(isset($_SESSION['uid']) && isset($_SESSION['username']) && isset($_SESSION['password'])){
    $full_name = $_SESSION['full_name'];
    $stmt = $dtb->prepare("SELECT id, username, full_name, bio, country FROM users WHERE full_name=:full_name");
    $stmt->bindValue(':full_name',$full_name,PDO::PARAM_INT); // ID IS ONLY GOING TOBE AN INTEGER
    //
    try{
        $stmt->execute();
         if($stmt->rowCount() > 0){
             // IF USER EXISTS AND THE SESSION STATMENTS ARE TRUE THEN THE USER_IS_LOGED AVRIABLE WILL BE CHANGES TO TRUE.
             $user_is_logged = true;
         }
    } 
    // CATHC ERRORS FROM QUERY.
    catch(PDOException $e){
        return false;
    }

  ?>

  <!DOCTYPE html>
  <!--[if lt IE 7]>      <html class="no-js lt-ie9 lt-ie8 lt-ie7">  <![endif]-->
  <!--[if IE 7]>         <html class="no-js lt-ie9 lt-ie8">             <![endif]-->
  <!--[if IE 8]>         <html class="no-js lt-ie9">                      <!  [endif]-->
  <!--[if gt IE 8]>    <!--> <html class="no-js">                   <!--<![endif]-->
    <head>

    <title> Atlis | Profile </title>

    <!-- META DATA -->
    <meta charset="UTF-8">
    <meta name="description" content="Atlis is your online travel bucket/wish list created using a map.">
    <meta name="keywords" content="Atlis, Travel Wish List, Travel Bucket Lsit, Interactive Maps, Google Map API, Erin-Katie Strapp">
    <meta name="author" content="Erin-Katie Strapp">
    <meta name="viewport" content="width=device-width, initial-scale = 1.0">

    <!-- CSS -->
    <link rel="stylesheet" type="text/css" href="stylesheets/reset.css"><!-- NORMAILISE STYLESHEET WILL RESSET THE BROWSER DEAFUALT STYLES --> 
    <link rel="stylesheet" type="text/css" href="stylesheets/grid.css"><!-- GRID.CSS WILL HELP PREPARE THE MARK-UP OF GOING RESPONSIVE -->
    <link rel="stylesheet" type="text/css" href="stylesheets/screen.css"><!-- THE MAIN.CSS WILL CONTAIN ALL THE MAIN CUSTOMED STYLES FOR THE SITE -->
    <link rel="stylesheet" type="text/css" href="stylesheets/media_queries.css"><!-- THE MEDIA QUERY STYLESHEET MAKES THE SITE MOBILE READY BY ADAPTING THE STYLE TO FIT THE SCREEN SIZE. -->

    <!-- SCRIPTS -->
    <script src="scripts/vendor/modernizr-2.6.2.min.js"></script><!-- USING THIS SCRIPT WILL FILE WILL HELP MAKE SURE THAT THE SITE IS COMPATIBALE ON DIFFERENT PLATFORMS EVEN WHEN USING HTML5 -->


</head>


<body id="wrap">

    <!--[if lt IE 7]>
        <p class="browsehappy">You are using an <strong>outdated</strong> browser. Please <a href="http://browsehappy.com/">upgrade your browser</a> to improve your experience.</p>
    <![endif]-->



        <div id="content">

            <header>

                <img src="images/profile/small-logo.png" alt="Atlis Logo" class="smlLogo" />

                <nav class="settings-menu">
                  <ul class="options">
                    <li>
                      <a href="#" class="icon"><img src="images/profile/settings.png" alt="settings"/></a>
                      <ul>
                        <li><a href="logout.php" class="settings-link">Logout</a></li>
                        <li><a href="#editBio" class="settings-link modalLink">Edit Profile</a></li>
                      </ul>
                    </li>
                  </ul>
                </nav><!-- CLOSES SETTINGS MENU -->
            </header>

            <!-- +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ -->

            <section id="google_map"></section>

            <!-- +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ -->

            <div id="profileContainer">

                <section id="profile">

                    <div class="avatar-frame">
                        <img src="images/test.jpg" alt="test" />
                    </div><!-- CLOSES AVATAR FRAME -->

                    <p class="profileUsername">Hello</p>
                    <p class="bio">

                    </p>
                </section><!-- CLOSES PROFILE SECTION -->

                <!-- +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ -->

                <section id="travelList">

                    <h2 class="profileTitle">My Travel List</h2>

                    <p class="travelList"></p>
                    <p> </p>

                </section><!-- CLOSES TRAVEL LIST SECTION --> 

                 <!-- +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ -->

                <section id="copyright">

                    <p>Copyright @ www.erin-katie.com 2014</p>

                </section><!-- CLOSES COPYRIGHT SECTION  -->

     <!-- +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ -->


                <!-- +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ -->

            </div><!-- CLOSES PROFILE CONTAINER DIV -->

            <!-- +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ -->

        </div><!-- CLOSES CONTENT DIV -->

        <!-- +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ -->

         <div class="overlay"></div><!-- OVERYLAY IS THE BACKGROUND THAT APPEARS UNDERNEATH THE MODAL BOXES -->

        <div id="editBio" class="modal">
            <h2 class="homeForm">Edit Profile</h2>
            <img src="images/homepage/close.png" alt="close" class="closeBtn" onmouseover="this.src='images/homepage/close-hover.png';" onmouseout="this.src='images/homepage/close.png';"/>


            <form action="bio.php" method="post" class="form" id="loginForm">
                <input type="text" name="username" placeholder="Edit username" tabindex="1" autofocus><br />
                <input type="text" name="full_name" placeholder="Edit full name" tabindex="1" autofocus><br />
                 <input type="text" name="country" placeholder="Edit country" tabindex="1" autofocus><br />
                <textarea rows="4" cols="50" name="bio"placeholder="Edit biograpphy"></textarea>
               <!--  <input type="file" name="file" id="file"><br> -->
                <button type="submit" class="signInBTN">Done</button>
            </form><!-- CLOSES REGISTARTION FORM -->


        </div><!-- CLOSES EDITBIO DIV MODAL -->


</body>

<!-- SCRIPTS -->
<script type="text/javascript" src="scripts/jquery-1.10.2.min.js"></script>
    <script type="text/javascript"src="https://maps.googleapis.com/maps/api/js?sensor=true"></script><!-- LINK TO GOOGLE MAP API -->
    <script type="text/javascript" src="scripts/map.js"></script><!-- JAVASCRIPT FILE FOR MAP API -->
    <script type='text/javascript' src='scripts/jquery.modal.js'></script><!-- PLUGIN FOR FORM-POP-UP -->
    <script type="text/javascript" src="scripts/scripts.js"></script>

</html>

推荐答案

刚刚意识到我遗漏了一个右大括号.

Just Realised that I left out the one of the closing curly brackets.

这篇关于PHP PDO,解析错误:语法错误,意外的 $end的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆