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

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • SAMARM
    New Member
    • Dec 2011
    • 5

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

    Code:
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
    <html>
    <head>
    <title>participator profile</title>
    <link rel="stylesheet" type="text/css" href="style.css">
    <link href="Stylle.css" rel="stylesheet" type="text/css" />
    </head>
    <body>
     <div id ="logo">
    <!----- insert logo below ------------------------------------------>
    <img src="img/sss.jpg"  height="123" width="100%" border="0" alt="">
    <!------------------------------------------------------------------>
    </div>
    <div>  </div>
    <div>  </div>
    <div>  </div>
    <div>  </div>
    <div>  </div>
     <div id = "nav">
    <!----- menu, insert links below ------------------------------------------>
    <div id="menu4">
    <ul id="menulist1">
    <li><a href="home.html">home</a></li>
    <li><a href=" ">upload research </a></li>
    <li><a href=" ">view symposium schedule</a></li>
    <li><a href=" ">log out</a></li>
    </ul>
    </div>
    <!-------------------------------------------------------------------------->
    </div>
    <div id = "container">
    <div id="content">
    <td width="100%">
    <div class="P">
    <p> 
    <font size="5" color="#1c436c">&nbsp;&nbsp;&nbsp;&nbsp; Schedule for Presentions </font>
    </div>
    </p>
    </br>
    <div class="Sc">
    <table border="1" cellpadding="2" cellspacing="2" width="100%">
    <?php
      $dbhost = "localhost";
      $dbuser = "root";
      $dbpass = "";
      $dbname = "sss";
      $conn = mysql_connect($dbhost, $dbuser, $dbpass)
      or die ('Error connecting to mysql');
     $result = mysql_query("SELECT * FROM V") 
    or die(mysql_error());  
    echo "<table border='1'>";
    echo "<tr> <th>Date</th> <th>Time</th><th>Research Title</th><th>Judge Name</th><th>Judge ID</th><th>Room</th> </tr> ";
    // keeps getting the next row until there are no more to get
    while($row = mysql_fetch_array( $result ))
     {
    	// Print out the contents of each row into a table
    	echo "<tr><td>"; 
    	echo $row['Data'];
    	echo "</td><td>"; 
    	echo $row['Time'];
    	echo "</td><td>"; 
    	echo $row['ResearchTitle'];
    	echo "</td><td>";
    	echo $row['JudgeName'];
    	echo "</td><td>";
    	echo $row['JudgeID'];
        echo "</td><td>";
        echo $row['Room'];
    	echo "</td></tr>";
    }
    echo "</table>";
    mysql_close($conn);
    ?>
    </body>
    </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
    Last edited by Stewart Ross; Dec 7 '11, 09:35 PM. Reason: Added code tags
  • phpmagesh
    New Member
    • Nov 2008
    • 119

    #2
    everything looks good!

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

    Code:
    $dbname = "sss";
      $conn = mysql_connect($dbhost, $dbuser, $dbpass) or die ('Error connecting to mysql');
    $db_name = mysql_select_db('dbname', $conn);
     $result = mysql_query("SELECT * FROM V")

    Comment

    • johny10151981
      Top Contributor
      • Jan 2010
      • 1059

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

      Comment

      • Ammu
        New Member
        • Aug 2011
        • 78

        #4
        Code:
        <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
        <html>
        <head>
        <title>participator profile</title>
        <link rel="stylesheet" type="text/css" href="style.css">
        <link href="Stylle.css" rel="stylesheet" type="text/css" />
        </head>
        <body>
         <div id ="logo">
        <!----- insert logo below ------------------------------------------>
        <img src="img/sss.jpg"  height="123" width="100%" border="0" alt="">
        <!------------------------------------------------------------------>
        </div>
        <div>  </div>
        <div>  </div>
        <div>  </div>
        <div>  </div>
        <div>  </div>
         <div id = "nav">
        <!----- menu, insert links below ------------------------------------------>
        <div id="menu4">
        <ul id="menulist1">
        <li><a href="home.html">home</a></li>
        <li><a href=" ">upload research </a></li>
        <li><a href=" ">view symposium schedule</a></li>
        <li><a href=" ">log out</a></li>
        </ul>
        </div>
        <!-------------------------------------------------------------------------->
        </div>
        <div id = "container">
        <div id="content">
        <td width="100%">
        <div class="P">
        <p> 
        <font size="5" color="#1c436c">&nbsp;&nbsp;&nbsp;&nbsp; Schedule for Presentions </font>
        </div>
        </p>
        </br>
        <div class="Sc">
        <table border="1" cellpadding="2" cellspacing="2" width="100%">
        <?php
          $conn = mysql_connect("localhost","root","password");
        mysql_select_db("databasename", $conn);
         $result = mysql_query("SELECT * FROM V")
        or die(mysql_error());  
        echo "<table border='1'>";
        echo "<tr> <th>Date</th> <th>Time</th><th>Research Title</th><th>Judge Name</th><th>Judge ID</th><th>Room</th> </tr> ";
        // keeps getting the next row until there are no more to get
        while($row = mysql_fetch_array( $result ))
         {
            // Print out the contents of each row into a table
            echo "<tr><td>"; 
            echo $row['Data'];
            echo "</td><td>"; 
            echo $row['Time'];
            echo "</td><td>"; 
            echo $row['ResearchTitle'];
            echo "</td><td>";
            echo $row['JudgeName'];
            echo "</td><td>";
            echo $row['JudgeID'];
            echo "</td><td>";
            echo $row['Room'];
            echo "</td></tr>";
        }
        echo "</table>";
        mysql_close($conn);
        ?>
        </body>
        </html>
        Last edited by Dormilich; Dec 8 '11, 12:31 PM. Reason: please use [CODE] [/CODE] tags when posting code

        Comment

        Working...