Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 987951
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 16, 20262026-05-16T05:33:57+00:00 2026-05-16T05:33:57+00:00

I am running PHP5 on a free web server and I am trying to

  • 0

I am running PHP5 on a free web server and I am trying to learn PHP reading a “for dummies” book…It gives me some code to run and for some infuriating reason I get errors on every line that echos HTML.

here is the code. specifics have been Xed out but they are accurate:

<?php
/* Program: mysql_up.php
* Desc: Connects to MySQL Server and
* outputs settings.
*/
echo “<html>
<head><title>Test MySQL</title></head>
<body>”;
$host=”XXXX”;
$user=”XXXX”;
$password=”XXXX”;
$cxn = mysqli_connect($host,$user,$password);
$sql=”SHOW STATUS”;
$result = mysqli_query($cxn,$sql);
if($result == false)
{
echo “<h4>Error: “.mysqli_error($cxn).”</h4>”;
}
else
{
/* Table that displays the results */
echo “<table border=’1’>
<tr><th>Variable_name</th>
<th>Value</th></tr>”;
for($i = 0; $i < mysqli_num_rows($result); $i++)
{
echo “<tr>”;
$row_array = mysqli_fetch_row($result);
for($j = 0;$j < mysqli_num_fields($result);$j++)
{
echo “<td>”.$row_array[$j].”</td>\n”;
}
}
echo “</table>”;
}
?>
</body></html>

Whenever it gets to a line that echos HTML I get this error or similar:

Parse error: syntax error, unexpected ‘>’ in /home/a7613610/public_html/mysql_up.php on line 6

I want to learn PHP but when it reports errors in supposedly good code it makes me not want to.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-16T05:33:58+00:00Added an answer on May 16, 2026 at 5:33 am

    The code is riddled with fancy quotes (“ and ”) which PHP cannot cope with. You could use your text editor to do a find and replace for both characters with the generic double quote character ". Although it definitely looks like you’re not using a plain text editor (see Mike Caron’s answer), I hope you’re using one. Word-processing and rich text editing software is not designed for writing programs and scripts.

    OK, so you’re using Notepad to write your PHP code. That’s great, but be aware that some eBook readers and even some books themselves mess with quote characters in code blocks and turn them fancy. This is one reason why copying and pasting code is frowned on 😉

    Also, if you want to learn PHP, or any form of programming in general, you should probably not expect books and tutorials to be perfect 😉

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm running PHP 5.2.3 on Windows 2000 Server with IIS 5. I'm trying to
I'm running PHP5 on Windows XP Professional. I'm trying to write a telnet php
I'm running PHP 5.2.6 on a Windows Server 2003 Enterprise box. IIS is set
On one Linux Server running Apache and PHP 5, we have multiple Virtual Hosts
I'm running PHP 5.2.8 on Apache 2.2.11 on Windows XP SP 3. In php.ini,
We're currently running with php 5.2.5. We have now encountered a bug that creates
Are there any major issues to be aware of running a PHP 5 /
PHP 4.4 and PHP 5.2.3 under Apache 2.2.4 on ubuntu. I am running Moodle
I am running Ubuntu8.041. Apache/2.2.8 (Ubuntu) PHP/5.2.4-2ubuntu5.3 with Suhosin-Patch configured Can't get file uploading
I am running php5 on my mac osx 10.5. If I write a simple

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.