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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 10, 20262026-05-10T18:47:12+00:00 2026-05-10T18:47:12+00:00

I am new to PHP and trying to get the following code to work:

  • 0

I am new to PHP and trying to get the following code to work:

<?php include 'config.php'; include 'opendb.php';  $query = 'SELECT name, subject, message FROM contact'; $result = mysql_query($query);  while($row = mysql_fetch_array($result, MYSQL_ASSOC)) {     echo 'Name :{$row['name']} <br>' .          'Subject : {$row['subject']} <br>' .           'Message : {$row['message']} <br><br>'; 'ARTICLE_NO :{$row['ARTICLE_NO']} <br>' . 'ARTICLE_NAME :{$row['ARTICLE_NAME']} <br>' . 'SUBTITLE :{$row['SUBTITLE']} <br>' . 'CURRENT_BID :{$row['CURRENT_BID']} <br>' . 'START_PRICE :{$row['START_PRICE']} <br>' . 'BID_COUNT :{$row['BID_COUNT']} <br>' . 'QUANT_TOTAL :{$row['QUANT_TOTAL']} <br>' . 'QUANT_SOLD :{$row['QUANT_SOLD']} <br>' . 'STARTS :{$row['STARTS']} <br>' . 'ENDS :{$row['ENDS']} <br>' . 'ORIGIN_END :{$row['ORIGIN_END']} <br>' . 'SELLER_ID :{$row['SELLER_ID']} <br>' . 'BEST_BIDDER_ID :{$row['BEST_BIDDER_ID']} <br>' . 'FINISHED :{$row['FINISHED']} <br>' . 'WATCH :{$row['WATCH']} <br>' . 'BUYITNOW_PRICE :{$row['BUYITNOW_PRICE']} <br>' . 'PIC_URL :{$row['PIC_URL']} <br>' . 'PRIVATE_AUCTION :{$row['PRIVATE_AUCTION']} <br>' . 'AUCTION_TYPE :{$row['AUCTION_TYPE']} <br>' . 'INSERT_DATE :{$row['INSERT_DATE']} <br>' . 'UPDATE_DATE :{$row['UPDATE_DATE']} <br>' . 'CAT_1_ID :{$row['CAT_1_ID']} <br>' . 'CAT_2_ID :{$row['CAT_2_ID']} <br>' . 'ARTICLE_DESC :{$row['ARTICLE_DESC']} <br>' . 'DESC_TEXTONLY :{$row['DESC_TEXTONLY']} <br>' . 'COUNTRYCODE :{$row['COUNTRYCODE']} <br>' . 'LOCATION :{$row['LOCATION']} <br>' . 'CONDITIONS :{$row['CONDITIONS']} <br>' . 'REVISED :{$row['REVISED']} <br>' . 'PAYPAL_ACCEPT :{$row['PAYPAL_ACCEPT']} <br>' . 'PRE_TERMINATED :{$row['PRE_TERMINATED']} <br>' . 'SHIPPING_TO :{$row['SHIPPING_TO']} <br>' . 'FEE_INSERTION :{$row['FEE_INSERTION']} <br>' . 'FEE_FINAL :{$row['FEE_FINAL']} <br>' . 'FEE_LISTING :{$row['FEE_LISTING']} <br>' . 'PIC_XXL :{$row['PIC_XXL']} <br>' . 'PIC_DIASHOW :{$row['PIC_DIASHOW']} <br>' . 'PIC_COUNT :{$row['PIC_COUNT']} <br>' . 'ITEM_SITE_ID :{$row['ITEM_SITE_ID']};  }  include 'closedb.php';  ?>  

However I get this error:

Parse error: syntax error, unexpected $end in C:\Programme\EasyPHP 2.0b1\www\test.php on line 56 

I would also like to know if there is perhaps an easier way to obtain mysql records instead of typing by hand?

edit:

I fixed the semicolon and quote issue, and now get:

Parse error: syntax error, unexpected T_STRING in C:\Programme\EasyPHP 2.0b1\www\test.php on line 51 

I am sorry I don’t know how to make colors in the code.

  • 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. 2026-05-10T18:47:12+00:00Added an answer on May 10, 2026 at 6:47 pm

    Edit

    You say that you’re still getting an error. Did you remember to add a . when you removed that extra semi-colon?


    You have a semi-colon in the middle of your string, two lines after the echo.

    Also, the end of the string is missing a double-quote.


    As far as a cleaner way to output all the values goes, you can loop over the result array like this:

    while($row = mysql_fetch_array($result, MYSQL_ASSOC)) {   foreach($row as $field=>$value)   {     echo '$field: {$value} <br />';   } } 
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Ask A Question

Stats

  • Questions 120k
  • Answers 120k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer I think what you're looking for is the method define_method… May 12, 2026 at 12:14 am
  • Editorial Team
    Editorial Team added an answer We just completed an upgrade to SL3 RTM, it went… May 12, 2026 at 12:14 am
  • Editorial Team
    Editorial Team added an answer getopt for R May 12, 2026 at 12:14 am

Related Questions

I am pretty new to php and could sure use some help understanding how
Thanks for all the great answers, this helps a lot! Hello, I need some
I am new to mod_rewrite. I am trying to forward a URL to another
Using PHP, and MySql, I am trying to implement this rather snazzy in-place editor

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

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.