473,395 Members | 2,795 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,395 software developers and data experts.

unexpected $end error

this error states mismatching but i didn't get the success in tracking that error, plss solve it out.... i am new to php therefore guide me the best practise that should help me.....
Expand|Select|Wrap|Line Numbers
  1. <?php
  2.  
  3. $host="localhost"; // Host name
  4. $username=""; // Mysql username
  5. $password=""; // Mysql password
  6. $db_name="test"; // Database name
  7. $tbl_name="test_mysql"; // Table name
  8.  
  9. // Connect to server and select database.
  10. mysql_connect("$host", "$username", "$password")or die("cannot connect");
  11. mysql_select_db("$db_name")or die("cannot select DB");
  12.  
  13. // Retrieve data from database
  14. $sql="SELECT * FROM $tbl_name";
  15. $result=mysql_query($sql);
  16.  
  17. // Start looping rows in mysql database.
  18. while($rows=mysql_fetch_array($result)){
  19. ?>
  20. <table width="400" border="1" cellspacing="0" cellpadding="3">
  21. <tr>
  22. <td width="10%"><? echo $rows['id']; ?></td>
  23. <td width="30%"><? echo $rows['name']; ?></td>
  24. <td width="30%"><? echo $rows['lastname']; ?></td>
  25. <td width="30%"><? echo $rows['email']; ?></td>
  26. </tr>
  27. </table>
  28.  
  29. <?
  30. // close while loop
  31. }
  32.  
  33. // close connection
  34. mysql_close();
  35. ?>
May 9 '10 #1
5 1227
Markus
6,050 Expert 4TB
On line 19, is that opening curly brace supposed to be there?
May 9 '10 #2
@Markus
kindly plss track the wrong code and do the require changes in it.... m new to php so slightly confused to trying anything...
May 9 '10 #3
Markus
6,050 Expert 4TB
I have tracked the error, and also told you where it is. Now you do the work.

Edit. Please do not modify the original code, without telling us that you have done so. The code, as it is now, should not be producing the error.
May 9 '10 #4
@Markus
actually the code that i was earliar posted was repeating while statement once more time which is not required.... could you plss check out this currently posted code.... m at the beginning phase so i need ur help as a senior....
May 9 '10 #5
Markus
6,050 Expert 4TB
I have no idea what your problem is now, so do enlighten me.
May 9 '10 #6

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

Similar topics

0
by: Robert Mazur | last post by:
MySQL 5.0 alpha (binary install) on Solaris 9 -or- RedHat 8.0 mysql-connector-java-3.0.8-stable ----------------------- Is there something different going on with JDBC and the alpha version...
6
by: Ehartwig | last post by:
I recently created a script for user verification, solved my emailing issues, and then re-created the script in order to work well with the new PHP 5 that I installed on my server. After...
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...
2
by: AB | last post by:
Hi to all, I have a problem about a importation of a file *.csv with SQL Server, through a bulk insert, called in a store procedure that a c# sw calls. This is the description of the error:...
1
by: basswhizz | last post by:
Hi guys im having trouble with somethings else now can you help out thanks!! Im getting this error message Parse error: syntax error, unexpected $end Here's my code cheers!!] <?php //...
1
by: Adrienne Boswell | last post by:
This is the strangest thing. On my local beta server (WinXP Pro SP3, PHP 5.2.3), I am getting an unexpected $end. On the production server, I am not. The files are identical. Just for shits and...
4
by: maveri4201 | last post by:
I have written a php script (test3.php), which I attached as a text file. Its includes are also attached as text files. I'm trying to run the script here: http://www.wondergy.com/phptestbed/test3.php...
10
shashahayes
by: shashahayes | last post by:
This is the message I am getting when I try to compile it. fatal error C1010: unexpected end of file while looking for precompiled header. Did you forget to add '#include "stdafx.h"' to your...
3
by: eshanne | last post by:
<?php get_header();?> <!-- begin col left --> <div id="colLeft"> <?php if (have_posts()) : while (have_posts()) : the_post(); ?> <!-- begin post --> <div class="blogPost clearfix">...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
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
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...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

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.