PHP error when sending data to screen

I'd like to run a PHP script to return the values in a database, I can do it with no problem but when I add the "Order by" into my script, I am getting an error.  This script worked great until I added the "order by".
Here is my simple script...Please advise:  
Here is when I connect to MYSQL (Left that part out)

$result = mysqli_query($con,"SELECT ItemNumber, StartingDate, EndingDate, SalePrice FROM biomas.ITProductSale order by ItemNumber");

 echo "<table border='1'>
 <th>Item Number</th>
 <th>Starting Date</th>
 <th>Ending Date</th>
 <th>Sale Price</th>

 while($row = mysqli_fetch_array($result))
   echo "<tr>";
   echo "<td>" . $row['ItemNumber'] . "</td>";
   echo "<td>" . $row['StartingDate'] . "</td>";
   echo "<td>" . $row['EndingDate'] . "</td>";
   echo "<td>" . $row['SalePrice'] . "</th>";
   echo "</tr>";
 echo "</table>";

Scott JohnstonIT Manager Asked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

What is the error you're getting?
What is biomas
Dave BaldwinFixer of ProblemsCommented:
I have never seen that cause a problem.  What is the error message?
Introducing Cloud Class® training courses

Tech changes fast. You can learn faster. That’s why we’re bringing professional training courses to Experts Exchange. With a subscription, you can access all the Cloud Class® courses to expand your education, prep for certifications, and get top-notch instructions.

Scott JohnstonIT Manager Author Commented:
Has to do with the line "echo "<tr>";"
Parse Error: syntax Error, unexpected T_ECHO in (FIle name)C:\Inetpub\xxxxxxxxxx\xxxxxxxxxxxxxxxx on line 21"

I do not see my error, or because I am sorting the data it will not print out the same...?
Scott JohnstonIT Manager Author Commented:
BIOMAS name of our MYSQL database
Is that an exact copy of your code?

while($row = mysqli_fetch_array($result))
   {I // what is the l doing here?
    echo "<tr>";

echo "<td>" . $row['SalePrice'] . "</th>";
You are opening a TD tag and closing a TH tag - no biggie but should be corrected.

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
Scott JohnstonIT Manager Author Commented:
I put the Select statement in MYSQL and it works perfectly....
Scott JohnstonIT Manager Author Commented:
Hmmm, missed that...Fixed everything>!!!!!!
Scott JohnstonIT Manager Author Commented:
Sometime it help to have more than one person looking at coding even as simple as this code...Thanks
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.