Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 3 of 3
  1. #1
    New to the CF scene
    Join Date
    Aug 2012
    Posts
    1
    Thanks
    0
    Thanked 0 Times in 0 Posts

    help getting php to display mysql tables

    here is my script

    <html>
    <head>
    <title>AdminCp</title>
    <style type="text/css">
    table {
    border: 2px solid red;
    background-color: #FFC;
    }

    th {
    border-bottom: 5px solid #000;
    }

    td {
    border-bottom: 2px solid #666;
    }
    </style>
    </head>
    <body>
    <h1>display data from db</h1>

    <?php
    include('connect-mysql.php');
    $sqlget = "SELECT * FROM easports
    $sqldata = mysqli_query($dbcon, $sqlget) or die('error');
    echo "<table>";
    echo "<tr><th>EaEmail</th><th>EaPassword</th></tr>";
    while($row = mysqli_fetch_array($sqldata, MYSQLI_ASSOC))
    {
    echo "<tr><td>";
    echo $row['EaEmail'];
    echo "</td><td>";
    echo $row['EaPassword']
    echo "</td></tr>";
    }
    echo "</table>";
    ?>

    </body>
    </html>

    and i get this error

    Parse error: syntax error, unexpected '>' in C:\xampp\htdocs\admin.php on line 26

    help please

  • #2
    Regular Coder Nile's Avatar
    Join Date
    Jun 2008
    Posts
    280
    Thanks
    2
    Thanked 46 Times in 46 Posts
    You really should learn what all of these errors mean and get a decent programming editor that has built in syntax highlighting.

    Take a look at your query. You're missing the closing quote and semi-colon.
    PHP Code:
    $sqlget "SELECT * FROM easports"

  • #3
    New to the CF scene
    Join Date
    Jul 2012
    Location
    New Delhi, India
    Posts
    4
    Thanks
    0
    Thanked 0 Times in 0 Posts
    its not a good sight to see such questions being posted here.
    apache is giving really helpful message by line number etc, this question should not have been part of this forum.
    It is for good of all of us - PHP coders.


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •