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 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

Related Questions

The following block of code works fine (no errors) $query = select * from
I'm trying to get php mailer to work. I'm getting an error but couldn't
I'm trying to following code but only get undefined in the alert box. Anyone
I'm painfully new to PHP, and was trying to set up phpBB on my
Hi I am quite new to php but i have been following some tutorials
I'm beginning a new project in PHP and I'd love to get some feedback
I'm fairly new to php and I am trying to figure how do I
I'm trying to use XPath in PHP and I get too many elements. This
I'm trying to consume the following web service http://ipinfodb.com/ip_location_api.php this web service returns an
Has anyone ever modified the post-new.php file in their WordPress installation? I want to

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.