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

i written this code and i have error this code to retrieve my data from

5
Expand|Select|Wrap|Line Numbers
  1. <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
  2. <html>
  3. <head>
  4. <title>participator profile</title>
  5. <link rel="stylesheet" type="text/css" href="style.css">
  6. <link href="Stylle.css" rel="stylesheet" type="text/css" />
  7. </head>
  8. <body>
  9.  <div id ="logo">
  10. <!----- insert logo below ------------------------------------------>
  11. <img src="img/sss.jpg"  height="123" width="100%" border="0" alt="">
  12. <!------------------------------------------------------------------>
  13. </div>
  14. <div>  </div>
  15. <div>  </div>
  16. <div>  </div>
  17. <div>  </div>
  18. <div>  </div>
  19.  <div id = "nav">
  20. <!----- menu, insert links below ------------------------------------------>
  21. <div id="menu4">
  22. <ul id="menulist1">
  23. <li><a href="home.html">home</a></li>
  24. <li><a href=" ">upload research </a></li>
  25. <li><a href=" ">view symposium schedule</a></li>
  26. <li><a href=" ">log out</a></li>
  27. </ul>
  28. </div>
  29. <!-------------------------------------------------------------------------->
  30. </div>
  31. <div id = "container">
  32. <div id="content">
  33. <td width="100%">
  34. <div class="P">
  35. <p> 
  36. <font size="5" color="#1c436c">&nbsp;&nbsp;&nbsp;&nbsp; Schedule for Presentions </font>
  37. </div>
  38. </p>
  39. </br>
  40. <div class="Sc">
  41. <table border="1" cellpadding="2" cellspacing="2" width="100%">
  42. <?php
  43.   $dbhost = "localhost";
  44.   $dbuser = "root";
  45.   $dbpass = "";
  46.   $dbname = "sss";
  47.   $conn = mysql_connect($dbhost, $dbuser, $dbpass)
  48.   or die ('Error connecting to mysql');
  49.  $result = mysql_query("SELECT * FROM V") 
  50. or die(mysql_error());  
  51. echo "<table border='1'>";
  52. echo "<tr> <th>Date</th> <th>Time</th><th>Research Title</th><th>Judge Name</th><th>Judge ID</th><th>Room</th> </tr> ";
  53. // keeps getting the next row until there are no more to get
  54. while($row = mysql_fetch_array( $result ))
  55.  {
  56.     // Print out the contents of each row into a table
  57.     echo "<tr><td>"; 
  58.     echo $row['Data'];
  59.     echo "</td><td>"; 
  60.     echo $row['Time'];
  61.     echo "</td><td>"; 
  62.     echo $row['ResearchTitle'];
  63.     echo "</td><td>";
  64.     echo $row['JudgeName'];
  65.     echo "</td><td>";
  66.     echo $row['JudgeID'];
  67.     echo "</td><td>";
  68.     echo $row['Room'];
  69.     echo "</td></tr>";
  70. }
  71. echo "</table>";
  72. mysql_close($conn);
  73. ?>
  74. </body>
  75. </html>

i have error

Parse error: syntax error, unexpected T_ECHO, expecting ',' or ';' in C:\xampp\htdocs\View.php on line 73

plz help me
Dec 7 '11 #1
3 1229
phpmagesh
119 100+
everything looks good!

you may need to add this for sure $db_name and need to select dbname which you have for your application.

Expand|Select|Wrap|Line Numbers
  1. $dbname = "sss";
  2.   $conn = mysql_connect($dbhost, $dbuser, $dbpass) or die ('Error connecting to mysql');
  3. $db_name = mysql_select_db('dbname', $conn);
  4.  $result = mysql_query("SELECT * FROM V") 
  5.  
  6.  
Dec 7 '11 #2
johny10151981
1,059 1GB
Your code is not showing the error you are talking about. check your file encoding. It can make the problem and

as phpmagesh suggested you will have to select database before you run select query
Dec 8 '11 #3
Ammu
78
Expand|Select|Wrap|Line Numbers
  1. <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
  2. <html>
  3. <head>
  4. <title>participator profile</title>
  5. <link rel="stylesheet" type="text/css" href="style.css">
  6. <link href="Stylle.css" rel="stylesheet" type="text/css" />
  7. </head>
  8. <body>
  9.  <div id ="logo">
  10. <!----- insert logo below ------------------------------------------>
  11. <img src="img/sss.jpg"  height="123" width="100%" border="0" alt="">
  12. <!------------------------------------------------------------------>
  13. </div>
  14. <div>  </div>
  15. <div>  </div>
  16. <div>  </div>
  17. <div>  </div>
  18. <div>  </div>
  19.  <div id = "nav">
  20. <!----- menu, insert links below ------------------------------------------>
  21. <div id="menu4">
  22. <ul id="menulist1">
  23. <li><a href="home.html">home</a></li>
  24. <li><a href=" ">upload research </a></li>
  25. <li><a href=" ">view symposium schedule</a></li>
  26. <li><a href=" ">log out</a></li>
  27. </ul>
  28. </div>
  29. <!-------------------------------------------------------------------------->
  30. </div>
  31. <div id = "container">
  32. <div id="content">
  33. <td width="100%">
  34. <div class="P">
  35. <p> 
  36. <font size="5" color="#1c436c">&nbsp;&nbsp;&nbsp;&nbsp; Schedule for Presentions </font>
  37. </div>
  38. </p>
  39. </br>
  40. <div class="Sc">
  41. <table border="1" cellpadding="2" cellspacing="2" width="100%">
  42. <?php
  43.   $conn = mysql_connect("localhost","root","password");
  44. mysql_select_db("databasename", $conn);
  45.  $result = mysql_query("SELECT * FROM V")
  46. or die(mysql_error());  
  47. echo "<table border='1'>";
  48. echo "<tr> <th>Date</th> <th>Time</th><th>Research Title</th><th>Judge Name</th><th>Judge ID</th><th>Room</th> </tr> ";
  49. // keeps getting the next row until there are no more to get
  50. while($row = mysql_fetch_array( $result ))
  51.  {
  52.     // Print out the contents of each row into a table
  53.     echo "<tr><td>"; 
  54.     echo $row['Data'];
  55.     echo "</td><td>"; 
  56.     echo $row['Time'];
  57.     echo "</td><td>"; 
  58.     echo $row['ResearchTitle'];
  59.     echo "</td><td>";
  60.     echo $row['JudgeName'];
  61.     echo "</td><td>";
  62.     echo $row['JudgeID'];
  63.     echo "</td><td>";
  64.     echo $row['Room'];
  65.     echo "</td></tr>";
  66. }
  67. echo "</table>";
  68. mysql_close($conn);
  69. ?>
  70. </body>
  71. </html>
Dec 8 '11 #4

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

Similar topics

5
by: Vanessa | last post by:
I have a question, is that any other way to retrieve data from another webpage besides using XML object? Because I am using XML object now but give me so much problems. If I used...
1
by: funcSter | last post by:
I want to retrieve data from an Excel file like how I would with a database. I understand that I would have to use OLE DB. Somehow I think I cannot get the connection string right, as the bit of...
2
by: Kash | last post by:
Hi everybody I have a session on my vb.net web applications first page to store an one dimensional array: dim myAry(2) As String myAry(0) = xVal myAry(1) = yVal...
1
by: hims | last post by:
hi i want to retrieve data from access through vb6.0 program but its not working. either sort out my error or help me with correct coding. thanks in advance !!!!!!! mail me at...
12
lifeisgreat20009
by: lifeisgreat20009 | last post by:
I am a newbie to Struts and JSP...I have been working on the code below for 5 hours now..I googled a lot but couldn't get much help so finally I am here.. Hoping of getting my problem solved. Please...
2
by: ghjk | last post by:
I want to write a php code for a login page. When I enter correct user name and password I got the error ;Warning: mysql_num_rows(): supplied argument is not a valid MySQL result resource in...
0
by: lenniekuah | last post by:
Hi Friends, I need your help. Please help me. I am trying to retrieve data from Excel Spreadsheet to fill the DataGridView for display prior to updating SQL SERVER with individual DataGridView...
0
by: michaelTun | last post by:
how can I retrieve data from oracle database to Visual Studio -2005 asp.net grid view. connection.Open() string sql = "select * from departments where department_id < 60" cmd = new...
0
by: michael Tun | last post by:
How can I retrieve data from oracle package. OracleCommand command = new OracleCommand("STAFF_SELECT", connection); command.CommandType = CommandType.StoredProcedure; STAFF_SELECT is...
0
by: lenniekuah | last post by:
Hullo Good Guys, I need your help. Please help me. I am very surprise of this error message: Index was out of range. Must be non-negative and less thatnt he size of the collection. Parameter name...
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...
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
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
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
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
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
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
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.