syntax error, unexpected T_ENCAPSED_AND_WHITESPACE, expecting T_STRING or T_VARIABLE

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • raja30march90
    New Member
    • Sep 2013
    • 1

    syntax error, unexpected T_ENCAPSED_AND_WHITESPACE, expecting T_STRING or T_VARIABLE

    I am new to php. I use the below query,

    Code:
    <?php
    if(isset($_POST['btn']))
    {
    $table=<<<table
    <table>
    <thead>
    <tr>		
    <th style="text-align:center">"#"</font></th>
    <th>1</font></th>
    <th>2</font></th>
    <th>3</font></th>
    <th>4</font></th>
    <th>5</font></th>
    <th>6</font></th>
    <th>7</font></th>
    <th>8</font></th>
    <th>9</font></th>
    <th>10</font></th>
    <th>11</font></th>
    <th>12</font></th>
    <th>13</font></th>
    <th>14</font></th>
    <th>15</font></th>
    <th>16</font></th>
    <th>17</font></th>
    <th>18</font></th>
    <th>19</font></th>
    <th>20</font></th>
    <th>21</font></th>
    <th>22</font></th>
    <th>23</font></th>
    <th>24</font></th>
    <th>25</font></th>
    <th>26</font></th>
    <th>27</font></th>
    <th>28</font></th>
    <th>29</font></th>
    <th>30</font></th>
    <th>31</font></th>
    </tr>
    </thead>
    <tbody>
    include ("DBconnection.php");
    $month_N="1";
    $Year_No = date("Y");
    $CurrentDate = date('Y-m-d');
    $Employee = $_POST['Employee'];
    //echo $Employe;
    if($Employee!="" && $Employee!="Select"){
    $EmployeeQuery="Select employeedetails_id, concat(firstname,' ', lastname) as EmpName, employeeenrollnumber from employeedetails where employeedetails.Status!='Dismissed' and employeedetails_id=".$Employee." order by firstname";
    }
    table;
    }
    It give the Syntax Error for me..

    Please help me any one ..
    Thanks...
    Last edited by Rabbit; Sep 10 '13, 03:44 PM. Reason: Please use code tags when posting code or formatted data.
  • Rabbit
    Recognized Expert MVP
    • Jan 2007
    • 12517

    #2
    What's going on with line 4-42? You can't just have HTML within PHP tags like that. If you want to output HTML within PHP tags, you need to echo them.

    Comment

    Working...