Only 1 record displaying?

Ask a Question related to Dreamweaver AppDev, Design and Development.

  1. #1

    Default Only 1 record displaying?

    Hi,
    I have a problem with Dreamweaver MX2004. I create my page as defined by the
    tutorial; connect to to my SQL database fine, displaying all the records in the
    test box, no problem there.

    I'm using PHP to call from the database and after creating the recordset page
    and adding a repeat region I only seem to display 1 database entry? The
    repeated region fails to display further records? Yet it is fine in test mode,
    displaying all records.

    This has been driving me mad for a few hours so I decided to come to the home
    of Macromedia to see if any of you great people could assist?

    I really appreciate any help provided.

    Thanks in advance if you can assist.
    Dave.


    h1ppy Guest

  2. Similar Questions and Discussions

    1. Displaying the newest record first..
      I know this is probably a brain dead question, but I can't remember how to display the latest database entry first, and the oldest entry last. Any...
    2. Displaying only a part of a record field
      I would like to output only a part of a record field which is returned by a query. For example the outputed text would look like: "Drawing has...
    3. Displaying Date From a Database Record
      Hi, Can anyone help??? I am trying to display the date that a record was posted to a database to an asp page but it appears in the wrong format...
    4. displaying a particular record in a particular location
      Greetings, I am working with two recordsets and I wish to display the last record from one of those sets in a particular place on a page, and...
    5. Update Record only displaying first entry of database in the details page
      Update Record only displaying first entry of database in the details page. It will update the record, it seems for some reason no matter what...
  3. #2

    Default Re: Only 1 record displaying?

    h1ppy wrote:
    > I'm using PHP to call from the database and after creating the recordset page
    > and adding a repeat region I only seem to display 1 database entry? The
    > repeated region fails to display further records? Yet it is fine in test mode,
    > displaying all records.
    I don't know whether you have more than one recordset on your page, but
    if you do, make sure that you select the correct one in the drop-down
    menu in the Repeat Region dialog box. Assuming you are displaying the
    results in a table, make sure the entire table row is selected before
    applying the server behavior.

    --
    David Powers
    Author, "Foundation PHP 5 for Flash" (friends of ED)
    Co-author "PHP Web Development with DW MX 2004" (Apress)
    [url]http://computerbookshelf.com[/url]
    David Powers Guest

  4. #3

    Default Re: Only 1 record displaying?

    Hi David,
    Thanks for the prompt reply. I am only using a single recordset on the page
    to try and figure this out. The correct recordset is selected in the drop down
    menu. The bottom table row is fully selected and the repeat region has then
    been applied.

    You can see it here: [url]http://kxfinance.co.uk/new.php[/url]

    As you can see it is only displaying a single record. There are 3 records in
    the database that I am using to test. They all display fine here:
    [url]http://www.kxfinance.co.uk/Event-Information-Database/Event_Information_view.php[/url]

    Basically I want the database to pull all the records of the events and their
    respective details. But it's failing every time for some reason.

    Any help appreciated.

    Thank you.

    h1ppy Guest

  5. #4

    Default Re: Only 1 record displaying?

    <?php require_once('Connections/event.php'); ?>
    <?php
    $currentPage = $_SERVER["PHP_SELF"];

    $maxRows_Recordset1 = 10;
    $pageNum_Recordset1 = 0;
    if (isset($_GET['pageNum_Recordset1'])) {
    $pageNum_Recordset1 = $_GET['pageNum_Recordset1'];
    }
    $startRow_Recordset1 = $pageNum_Recordset1 * $maxRows_Recordset1;

    mysql_select_db($database_event, $event);
    $query_Recordset1 = "SELECT * FROM Event_Information";
    $query_limit_Recordset1 = sprintf("%s LIMIT %d, %d", $query_Recordset1,
    $startRow_Recordset1, $maxRows_Recordset1);
    $Recordset1 = mysql_query($query_limit_Recordset1, $event) or
    die(mysql_error());
    $row_Recordset1 = mysql_fetch_assoc($Recordset1);

    if (isset($_GET['totalRows_Recordset1'])) {
    $totalRows_Recordset1 = $_GET['totalRows_Recordset1'];
    } else {
    $all_Recordset1 = mysql_query($query_Recordset1);
    $totalRows_Recordset1 = mysql_num_rows($all_Recordset1);
    }
    $totalPages_Recordset1 = ceil($totalRows_Recordset1/$maxRows_Recordset1)-1;

    $queryString_Recordset1 = "";
    if (!empty($_SERVER['QUERY_STRING'])) {
    $params = explode("&", $_SERVER['QUERY_STRING']);
    $newParams = array();
    foreach ($params as $param) {
    if (stristr($param, "pageNum_Recordset1") == false &&
    stristr($param, "totalRows_Recordset1") == false) {
    array_push($newParams, $param);
    }
    }
    if (count($newParams) != 0) {
    $queryString_Recordset1 = "&" . htmlentities(implode("&", $newParams));
    }
    }
    $queryString_Recordset1 = sprintf("&totalRows_Recordset1=%d%s",
    $totalRows_Recordset1, $queryString_Recordset1);
    ?>
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
    "http://www.w3.org/TR/html4/loose.dtd">
    <html>
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
    <title>Untitled Document</title>
    </head>

    <body>
    <table width="100%" border="0" cellspacing="2" cellpadding="2">
    <tr>
    <td><strong>Event Promoter </strong></td>
    <td><strong>Event Name </strong></td>
    <td><strong>Event Location </strong></td>
    <td><strong>Event Date</strong></td>
    <td><strong>Event Type </strong></td>
    <td><strong>Ticker Cost </strong></td>
    <td><strong>Event Attendance</strong></td>
    <td><strong>Event Website</strong></td>
    </tr>
    <tr>
    <td><?php echo $row_Recordset1['Event_Promoter']; ?></td>
    <td><?php echo $row_Recordset1['Event_Name']; ?></td>
    <td><?php echo $row_Recordset1['Event_Location']; ?></td>
    <td><?php echo $row_Recordset1['Event_Date']; ?></td>
    <td><?php echo $row_Recordset1['Event_Type']; ?></td>
    <td><?php echo $row_Recordset1['Ticekt_Cost']; ?></td>
    <td><?php echo $row_Recordset1['Event_Attendance']; ?></td>
    <td><?php echo urldecode($row_Recordset1['Event_Website']); ?></td>
    </tr>
    <tr>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    </tr>
    <?php do { ?>
    <tr>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    </tr>
    <?php } while ($row_Recordset1 = mysql_fetch_assoc($Recordset1)); ?>
    </table>

    </body>
    </html>
    <?php
    mysql_free_result($Recordset1);
    ?>


    h1ppy Guest

  6. #5

    Default Re: Only 1 record displaying?

    h1ppy wrote:

    Right, I can see where you're making the mistake. You need to highlight
    the row that contains your dynamic data from the Bindings panel. You
    need to highlight this table row:
    > <tr>
    > <td><?php echo $row_Recordset1['Event_Promoter']; ?></td>
    > <td><?php echo $row_Recordset1['Event_Name']; ?></td>
    > <td><?php echo $row_Recordset1['Event_Location']; ?></td>
    > <td><?php echo $row_Recordset1['Event_Date']; ?></td>
    > <td><?php echo $row_Recordset1['Event_Type']; ?></td>
    > <td><?php echo $row_Recordset1['Ticekt_Cost']; ?></td>
    > <td><?php echo $row_Recordset1['Event_Attendance']; ?></td>
    > <td><?php echo urldecode($row_Recordset1['Event_Website']); ?></td>
    > </tr>
    And then apply the server behavior. What you're doing is applying it to
    an empty row *below* the dynamic data:
    > <?php do { ?>
    > <tr>
    > <td>&nbsp;</td>
    > <td>&nbsp;</td>
    > <td>&nbsp;</td>
    > <td>&nbsp;</td>
    > <td>&nbsp;</td>
    > <td>&nbsp;</td>
    > <td>&nbsp;</td>
    > <td>&nbsp;</td>
    > </tr>
    > <?php } while ($row_Recordset1 = mysql_fetch_assoc($Recordset1)); ?>
    As a result, only the first row of data displays, and you get two empty
    rows.

    In Code view, when you've applied it correctly, your table should look
    like this:

    <table width="100%" border="0" cellspacing="2" cellpadding="2">
    <tr>
    <td><strong>Event Promoter </strong></td>
    <td><strong>Event Name </strong></td>
    <td><strong>Event Location </strong></td>
    <td><strong>Event Date</strong></td>
    <td><strong>Event Type </strong></td>
    <td><strong>Ticker Cost </strong></td>
    <td><strong>Event Attendance</strong></td>
    <td><strong>Event Website</strong></td>
    </tr>
    <?php do { ?>
    <tr>
    <td><?php echo $row_Recordset1['Event_Promoter']; ?></td>
    <td><?php echo $row_Recordset1['Event_Name']; ?></td>
    <td><?php echo $row_Recordset1['Event_Location']; ?></td>
    <td><?php echo $row_Recordset1['Event_Date']; ?></td>
    <td><?php echo $row_Recordset1['Event_Type']; ?></td>
    <td><?php echo $row_Recordset1['Ticekt_Cost']; ?></td>
    <td><?php echo $row_Recordset1['Event_Attendance']; ?></td>
    <td><?php echo urldecode($row_Recordset1['Event_Website']); ?></td>
    </tr>
    <?php } while ($row_Recordset1 = mysql_fetch_assoc($Recordset1)); ?>
    </table>

    --
    David Powers
    Author, "Foundation PHP 5 for Flash" (friends of ED)
    Co-author "PHP Web Development with DW MX 2004" (Apress)
    [url]http://computerbookshelf.com[/url]
    David Powers Guest

  7. #6

    Default Re: Only 1 record displaying?

    Thanks David!

    I found another way around the problem as well. The tutorial skips a whole
    process whereby you have to drag a repeat of the original binding in to the
    repeat region area, for each field to be represented in the database. Unless
    you follow your instructions above.

    Silly but it's not covered in the tutorial.

    Stumped me for a while!

    Thanks to David.

    I owe you a beer. :)


    h1ppy Guest

  8. #7

    Default Re: Only 1 record displaying?

    h1ppy wrote:
    > Silly but it's not covered in the tutorial.
    Yes, it is silly. I've never done the tutorial, so I'm not familiar with
    its contents.
    > I owe you a beer. :)
    I'll drink to that. Cheers.

    --
    David Powers
    Author, "Foundation PHP 5 for Flash" (friends of ED)
    Co-author "PHP Web Development with DW MX 2004" (Apress)
    [url]http://computerbookshelf.com[/url]
    David Powers Guest

  9. #8

    Cool Re: Only 1 record displaying?

    knob jockeys the lot of ya
    Unregistered Guest

Posting Permissions

  • You may not post new threads
  • You may post replies
  • You may not post attachments
  • You may not edit your posts

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139