473,386 Members | 1,775 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

How to Parse error: syntax error, unexpected $end in . . .?

Hello - I am super green to php and mysql. I have received the following error: Parse error: syntax error, unexpected $end in C:\website\chart.php on line 84... I have been through the code matching all of my {}, [], "", and '', and I can't find anything mis-matched. Also, there is no line 84. Any insights would be greatly appreciated. The code ia as follows:
Expand|Select|Wrap|Line Numbers
  1. <?php
  2.  
  3.   $conn = @new mysqli('localhost', 'root', 'bonkers1', 'prodtestdata');
  4.  
  5.   if (mysqli_connect_errno() != 0)
  6.   {
  7.     $errno = mysqli_connect_errno();
  8.     $errmsg = mysqli_connect_error();
  9.     echo "Connect Failed with: ($errno) $errmsg<br/>\n";
  10.     exit;
  11.   }
  12.  
  13.   $conn->query("SET NAMES 'utf8'");
  14.  
  15.   // prepare the query 
  16.   $query_str = "SELECT * FROM prodtestdata";
  17.   $result = $conn->query($query_str);
  18.   if ($result === FALSE)
  19.   {
  20.     $errno = $conn->errno;
  21.     $errmsg = $conn->error;
  22.     echo "Connect Failed with: ($errno) $errmsg<br/>\n";
  23.     $conn->close();
  24.     exit;
  25.   } 
  26.   else
  27.   {
  28.     echo <<<EOM
  29.   <table>
  30.   <tr>
  31.     <td>Product Name</td>
  32.     <td>Product Size</td>
  33.     <td>Structural Rating</td>
  34.     <td>Air Rating</td>
  35.     <td>Water Rating</td>
  36.     <td>U-Factor</td>
  37.     <td>SHGC</td>
  38.     <td>VT</td>
  39.   </tr>
  40. EOM;
  41.  
  42.     // get the data
  43.     while (($row_data = @$result->fetch_assoc()) !==NULL)
  44.     {
  45.       echo <<<EOM
  46.     <tr>
  47.       <td>{$row_data['prod_name']}</td>
  48.       <td>{$row_data['prod_size']}</td>
  49.       <td>{$row_data['aama_rate']}</td>
  50.       <td>{$row_data['air_rate']}</td>
  51.       <td>{$row_data['water_rate']}</td>
  52.       <td>{$row_data['u_rate']}</td>
  53.       <td>{$row_data['shgc_rate']}</td>
  54.       <td>{$row_data['vt_rate']}</td>
  55.     </tr>
  56.  
  57.   EOM;
  58.     }
  59.  
  60.     echo <<<EOTABLE
  61.   </table>
  62.  
  63. EOTABLE;
  64.     //
  65.     // clean up results
  66.     //
  67.     $result->close();
  68.   }
  69.   //
  70.   // clean up connection
  71.   //
  72.   $conn->close();
  73.  
  74. ?>
  75.  
  76.  
Much Thanks,
Ann
Nov 17 '10 #1
3 2598
Dormilich
8,658 Expert Mod 8TB
line #57: Heredoc closing delimiter must start at the beginning of the line.
Nov 18 '10 #2
Well I'll be - I would have never found that - works just fine now - thank you so much! Have a great weekend!
Nov 18 '10 #3
Dormilich
8,658 Expert Mod 8TB
thanks. well, I wouldn’t know myself had I not have had such problems myself.
Nov 19 '10 #4

Sign in to post your reply or Sign up for a free account.

Similar topics

8
by: Wescotte | last post by:
The error message Parse error: syntax error, unexpected $end in FILE on line X is one I run into frequently and I know the cause is I missed an ending quote. Is there an easy way to determine...
5
praclarush
by: praclarush | last post by:
I've just started php, and this is a class assignment, but my question is I’m getting this error PHP Parse error: syntax error, unexpected T_IF, expecting T_VARIABLE or '$' in...
9
by: ajd335 | last post by:
Hi all... I am getting an error Parse error: syntax error, unexpected $end in http:/..... on line 117...(117 is the EOF).. can you plz help me out..I have checked out for the < , > ,{ ,} etc.......
9
akohistani
by: akohistani | last post by:
I am having Parse error problem with my newly purchased Php upload script I have uploaded the script and I get the error below Parse error: syntax error, unexpected $end in URL/functions.php on...
10
by: benicio | last post by:
Parse error: syntax error, unexpected T_STRING, expecting '(' in C:\wamp\www\study_group\includes\functions.php on line 19 I got this error and this syntax is from 8 to 19th line. <?php ...
2
by: TanjaPetro | last post by:
Hello to everyone. I changed a few files on my site and when I tried to log into the admin area I got this message: Parse error: syntax error, unexpected T_CONSTANT_ENCAPSED_STRING, expecting...
13
Topbidder
by: Topbidder | last post by:
I have this error on the code Parse error: syntax error, unexpected '"' in /home/topbidd/public_html/bid2/bid_classic.php on line 159 now i thought the error was this It seems that the...
3
by: CYNTHIA CUTRER | last post by:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en"> <head> ...
5
by: vultren | last post by:
Parse error: syntax error, unexpected $end in I keep getting that, I have no clue where to fix it. Any help would be VERY APPRECIATED! <?php if(isset($_POST)) { // EDIT THE 2 LINES...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.