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

  • Home
  • SEARCH
  • 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 8826249
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T07:05:29+00:00 2026-06-14T07:05:29+00:00

Possible Duplicate: Parse error: syntax error, unexpected T_STRING 59 I have a database with

  • 0

Possible Duplicate:
Parse error: syntax error, unexpected T_STRING 59

I have a database with names that I would like displayed in the form of a table with checkboxes. Everything works until I try to place the html tag into my php code. When I put the input tag in it gives me the error:

Parse error: syntax error, unexpected T_STRING, expecting ‘,’ or ‘;’

I can’t see where I would put a comma or semi colon.

<form>
    <?php
    $name = $_POST['name'];

    $host = "mysql16.000webhost.com";
    $user_name = "a1611480_akaash";
    $pwd = "****";
    $database_name = "a1611480_akaash";
    $db = mysql_connect($host, $user_name, $pwd);

    mysql_select_db($database_name);

    $result = mysql_query("SELECT name FROM Sort");

    $var = array();
    while ($row = mysql_fetch_array($result)) {
        $var[] = $row['name'];
    }

    $unique = array_unique($var);

    foreach ($unique as $value) {

        echo "<p class = Body_text><label>$value</label> <input type="checkbox" name="name" value="$value" /> </p>\n";
    }
    ?>
</form>
  • 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-06-14T07:05:30+00:00Added an answer on June 14, 2026 at 7:05 am

    Replace this:

    echo "<p class = Body_text><label>$value</label> <input type="checkbox" name="name" value="$value" /> </p>\n"
    

    with this:

    echo <<<EOD
    <p class = Body_text><label>$value</label> <input type="checkbox" name="name" value="$value" /> </p>
    EOD;
    

    … This uses HEREDOC syntax, which easily bypasses most of your quotation issues. However, it comes with an important caveat: the line EOD; must not be indented and there cannot be anything else on that line (such as trailing spaces).

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

Sidebar

Related Questions

Possible Duplicate: Parse error: syntax error, unexpected ‘.’, expecting ‘,’ or ‘;’ I have
Possible Duplicate: Parse error: syntax error, unexpected T_FUNCTION line 10 ? help? Reference -
Possible Duplicate: Parse error: syntax error, unexpected ‘(’, expecting ‘,’ or ‘;’ in I'm
Possible Duplicate: Parse error on explode('-','foo-bar')[0] (for instance) In PHP there are functions that
Possible Duplicate: Get and Parse CSV file in android I would like to store
Possible Duplicate: How to parse and process HTML with PHP? I have HTML document
Possible Duplicate: How to parse JSON in JavaScript I have this JSON string: [{title:
Possible Duplicate: how to parse hex or decimal int in Python i have a
Possible Duplicate: jQuery won't parse my JSON from AJAX query So I have parsed
Possible Duplicate: How to parse JSON in JavaScript Hi I have to parse the

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.