Professional Web Applications Themes

Showing a specific record from a recordset - Dreamweaver AppDev

Hi, I am trying to find a way of displaying a specific record (the latest one entered by a user) from a recordset as opposed all of the records or just the first record in a recordset. This is so the user can view what they have entered, and only what they have entered. Do I need to pass specific parameters or something? Can anyone explain what I need to do or direct me to a tutorial? Thanks,...

  1. #1

    Default Showing a specific record from a recordset

    Hi, I am trying to find a way of displaying a specific record (the latest one
    entered by a user) from a recordset as opposed all of the records or just the
    first record in a recordset. This is so the user can view what they have
    entered, and only what they have entered. Do I need to pass specific parameters
    or something? Can anyone explain what I need to do or direct me to a tutorial?
    Thanks,

    pporter Guest

  2. #2

    Default Re: Showing a specific record from a recordset

    Why not have a dynamic table that displays the records the user has entered and sort it descending?
    wee_elks Guest

  3. #3

    Default Re: Showing a specific record from a recordset

    Hi, yeah I was hoping to go down that road but when I create it I can only have
    the dynamic table sitting on the same page that the user inputs their data. I
    was hoping to have them click 'submit' and then go to a separate detailed page
    that has the dynamic data. Any ideas?

    pporter Guest

  4. #4

    Default Re: Showing a specific record from a recordset

    You can create an id# manually for each record with javascript and a hidden field then in your recordset options sort the ID column in descending order
    Clukey Guest

  5. #5

    Default Re: Showing a specific record from a recordset

    Hi Clukey,

    Thank you so much for your help, that was exactly what I was after!

    Does anyone know how to do any of the following?

    1) I have set up some dynamic image regions in a table, and only want them to
    display if there is an image in the recordset. However, when I set the 'show
    region if recordset is not emptry' server behaviour for that table, even if
    there isn't an image in the database it still shows a broken image. Any ideas?

    AND...

    2) When users come to ym site to insert data and images, I want them to be
    able to edit their data before they submit it. What behaviour do I need to use
    that allows them to 'edit' their data and re-send so it uses the same ID in the
    database as opposed to creating a new one?

    Many thanks in advance to whoever can help or point me in the right direction.

    Patrick

    pporter Guest

  6. #6

    Default Re: Showing a specific record from a recordset

    Patrick,

    For the first one, if an image has no src it will always show a broken image,
    so you will need to create a default image to shows if there isn't one in the
    database, you could just use a transparent square.

    For the latter, look into the Update Record server behavior.

    Clukey Guest

  7. #7

    Default Re: Showing a specific record from a recordset

    Hi Clukey,

    Thank you so much for taking the time to help me with this, much appreciated.

    Regards,
    Patrick
    pporter Guest

  8. #8

    Default Re: Showing a specific record from a recordset

    Patrick, sorry I misunderstood your question about the broken image, I think I
    do now though, and the 'show region if recordset is not emptry' server behavior
    won't work for what your trying to do, so replace it with this code.


    <?php if (strlen($row_yourRecordset['yourImageField']) > 0) { ?>
    <img src="<?php echo $row_yourRecordset['yourImageField']; ?>" width="width"
    height="height">
    <?php } ?>


    And replace "yourRecordset" , "yourImageField" , "width" and "height" with
    your information

    Clukey

    Clukey Guest

  9. #9

    Default Re: Showing a specific record from a recordset

    (I accidentally posted this originally in the General Discussion Forum - sorry
    for the duplicate but I realized that it probably belongs in this forum.)

    I have a dynamic page (PHP) set up to display information from a database
    (mySQL) in the format:

    Name1
    Name2
    Address1
    Address2
    City, ST ZIP

    However many entries in the database do not have a Name2 or an Address2 (the
    field is blank in the database). So, when the page is displayed for entries
    lacking Name2 or Address2, it puts a blank line in that field, for example:

    John Doe

    123 Main Street

    Anytown, US 12345

    How do I make it not display fields if there is nothing to display? The end
    result should look like:

    John Doe
    123 Main Street
    Anytown, US 12345

    Of course some records do have Name2 and Address2 fields and I need them to
    display. I have tried using the "show if recordset is not empty" behavior, but
    the record set will never be completely empty so that does not work. Thanks!!

    Kyle R.

    Kyle R. Guest

  10. #10

    Default Re: Showing a specific record from a recordset

    Kyle, you can use the same code I showed Patrick in my last post, just change the <img> tag to your dynamic text and replace "yourRecordset" and "yourImageField" with your information.
    Clukey Guest

  11. #11

    Default Re: Showing a specific record from a recordset

    Clukey,

    Thanks for the info! I will give that a try and see if I can get it right! I am quite new at this... :-)

    Thanks again!
    Kyle R. Guest

Similar Threads

  1. Extracting specific record from XML
    By redtiger in forum Macromedia Flash Data Integration
    Replies: 0
    Last Post: May 9th, 10:14 PM
  2. how to go to a specific record
    By Johnny in forum Coldfusion Database Access
    Replies: 2
    Last Post: August 7th, 09:59 PM
  3. Move to specific record
    By Hiiii Ej. in forum Macromedia Exchange Dreamweaver Extensions
    Replies: 2
    Last Post: May 31st, 05:56 PM
  4. Loading a recordset at the last record?
    By Murray *TMM* in forum Dreamweaver AppDev
    Replies: 10
    Last Post: May 9th, 10:34 AM
  5. Dynamic dropdown not showing true recordset (PHP/MySQL)
    By wildwildwebs in forum Dreamweaver AppDev
    Replies: 0
    Last Post: February 16th, 05:24 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not 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