Displaying records

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • ddtpmyra
    Contributor
    • Jun 2008
    • 333

    #1

    Displaying records

    My php sql query display the correct number of rows I can tell because it displyas the row and columns but the cell or data are blank.

    [PHP]
    # Get the ID

    $id = $_GET['id'];

    // Connect to server and select databse.



    $sql="SELECT * FROM $tbl_name where cmrid= {$id} ORDER BY id DESC" ;
    $result=mysql_q uery($sql); echo"$sql $result";
    ?>[/PHP]

    [PHP]//here's where I display my result
    <?php
    while($rows=mys ql_fetch_array( $result)){ // Start looping table row
    ?>
    <td bgcolor="#FFFFF F"><? echo $rows['cmrid']; ?></td>
    <td bgcolor="#FFFFF F"><a href="view_topi c.php?id=<? echo $rows['id']; ?>"><? echo $rows['topic']; ?></a><BR></td>
    <td align="center" bgcolor="#FFFFF F"><? echo $rows['view']; ?></td>
    <td align="center" bgcolor="#FFFFF F"><? echo $rows['reply']; ?></td>
    <td align="center" bgcolor="#FFFFF F"><? echo $rows['datetime']; ?></td>

    <?php
    // Exit looping and close connection
    }
    mysql_close();
    ?>[/PHP]
  • Markus
    Recognized Expert Expert
    • Jun 2007
    • 6092

    #2
    Have you tried using the *correct* opening tags instead of just <? ... ?>

    Comment

    • dlite922
      Recognized Expert Top Contributor
      • Dec 2007
      • 1586

      #3
      Originally posted by Markus
      Have you tried using the *correct* opening tags instead of just <? ... ?>
      lol

      Why do you get the easy ones? Are you on this site like 24/7?

      :P




      Dandeezy

      Comment

      • Markus
        Recognized Expert Expert
        • Jun 2007
        • 6092

        #4
        Originally posted by dlite922
        lol

        Why do you get the easy ones? Are you on this site like 24/7?

        :P




        Dandeezy
        Haha, I afraid I pretty much iz! A lot of spare time at the moment. I'll leave you a few from now on :P

        Comment

        • ddtpmyra
          Contributor
          • Jun 2008
          • 333

          #5
          I guess some of syntax varies on the platform used. Thanks for extending the information (help)

          DM

          Comment

          • Markus
            Recognized Expert Expert
            • Jun 2007
            • 6092

            #6
            Originally posted by ddtpmyra
            I guess some of syntax varies on the platform used. Thanks for extending the information (help)

            DM
            Indeed it does vary. You have to have short tags enabled in the PHP.INI file.

            See you around.

            Markus.

            Comment

            Working...