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 8483637
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T20:09:36+00:00 2026-06-10T20:09:36+00:00

I am trying to query and select data from an sql table and then

  • 0

I am trying to query and select data from an sql table and then display it in html. This is my code.

$result = mysqli_query($dbhandle, $query)
    or die(mysql_error().'<br>SQL:'.$query);
echo '<table style ="border:1px solid black;">';

while($row = mysqli_fetch_array($result)) {
    echo '<tr>';
    echo '<td style="border:1px solid black;">{$row['first_name']}</td>';
    echo '<td style="border:1px solid black;">{$row['last_name']}</td>';
    echo '<td style="border:1px solid black;">{$row['grade']}</td>';
    echo '<td style="border:1px solid black;">{$row['gpaP']}</td>';
    echo "<td style="border:1px solid black;">{$row['AGP']}</td>";
    echo "<td style="border:1px solid black;">{$row['awardP']}</td>";
    echo "<td style="border:1px solid black;">{$row['awardTP']}</td>";
    echo "<td style="border:1px solid black;">{$row['rigorP']}</td>";
    echo "<td style="border:1px solid black;">{$row['APP']}</td>";
    echo "<td style="border:1px solid black;">{$row['positionP']}</td>";
    echo "<td style="border:1px solid black;">{$row['hoursP']}</td>";
    echo "<td style="border:1px solid black;">{$row['selectionP']}</td>";
    echo "<td style="border:1px solid black;">{$row['activityTypeP']}</td>";
    echo "<td style="border:1px solid black;">{$row['activityYearsP']}</td>";
    echo "<td style="border:1px solid black;">{$row['date']}</td>";
    echo "<td style="border:1px solid black;">{$row['IP']}</td>";
    echo '</tr>';
}
echo '</table>';

It gives me an error saying there is an unexpected string at the last_name cell. If I remove the style parameters from the cells it works. Somebody point out my error please?

  • 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-10T20:09:38+00:00Added an answer on June 10, 2026 at 8:09 pm

    Your code mixes two different styles of quotes, both of which are valid in PHP and both of which require some additional escaping.

    You should pick a style (either wrap in single quotes or wrap in double quotes) and then make sure you escape quotes of the same type within the string.

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

Sidebar

Related Questions

i'm trying to do this query: SELECT * FROM TABLE WHERE value1='THIS'S AN EXAMPLE'.
I currently am trying the following code: $sql = $db->query(select id,username,fullname from userss ORDER
i'm trying the following MySQL query to fetch some data: SELECT m.*, t.* FROM
I am trying to extract the below query: select '<tr><td>'||column1||'</td>', '<td>'||column2||'</td>', '<td>'||column3||'</td></tr>' from table
I'm trying to insert variables from an SQL result into a HTML form in
I am trying to pull data from SQL, and then write it to a
I am trying to run the following query: SELECT COUNT(*) FROM ( SELECT *
I'm trying to introduce a join to this query: SELECT `n`.*, round((`n`.`rgt` - `n`.`lft`
I am trying to have information displayed for this query: SELECT o.sub_number,o.unique_id,o.period_from,o.period_to,o.total_amt, i.paid_amt,i.dated,i.payment,i.paid_by,i.entered_date,i.paid_for_unique, j.cheque_num,j.drawn_on,j.dated
I'm trying to do a query in hibernate like the following sql query: SELECT

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.