...

View Full Version : help getting php to display mysql tables



TheUnknownCoder
08-16-2012, 04:19 AM
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

Nile
08-16-2012, 06:58 AM
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.

$sqlget = "SELECT * FROM easports";

qtriangle
08-17-2012, 07:37 PM
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.



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum