Detail Page shows Record 1

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

  1. #1

    Default Detail Page shows Record 1

    Was working my way through Matt Brown's Tutorial (Recordstore on Macromedia
    site
    [url]http://www.macromedia.com/devnet/mx/dreamweaver/articles/record_store.html[/url]) but
    have experienced problems with the Detail page and Edit page. I used MySQL and
    PHP on a Remote Server and Database. No mater what record you click on in the
    Master page, it shows the same value in the detail Page i.e. the Deault Record.
    When running a test on the Variable within the Recordset (Detail page), it
    returns the Default record only. Same applies when editing a page from a link
    in the Master page. When creating the Variable within the Recordset (Detail
    page), the Tutorial gives the values to be input; Variable Name = colname,
    Default = 1, and Run Time Value =$HTTP_GET_VARS['albumid']. I have checked,
    rechecked and checked again to no avail. Can anyone help? Please find code
    attached <?php require_once('Connections/THP.php'); ?> <?php
    $colname_albumdetail = '1'; if (isset($HTTP_GET_VARS['albumid'])) {
    $colname_albumdetail = (get_magic_quotes_gpc()) ? $HTTP_GET_VARS['albumid'] :
    addslashes($HTTP_GET_VARS['albumid']); } mysql_select_db($database_THP, $THP);
    $query_albumdetail = sprintf('SELECT * FROM album, artist WHERE album.artistid
    = artist.artistid AND albumid = %s', $colname_albumdetail); $albumdetail =
    mysql_query($query_albumdetail, $THP) or die(mysql_error()); $row_albumdetail =
    mysql_fetch_assoc($albumdetail); $totalRows_albumdetail =
    mysql_num_rows($albumdetail); ?> <html> <head> <title>Untitled Document</title>
    <meta http-equiv='Content-Type' content='text/html; charset=iso-8859-1'>
    </head> <body link='#0000FF' vlink='#0000FF'> <div align='center'> <p><font
    size='5' face='Arial, Helvetica, sans-serif'>Album Detail Page </font></p>
    <table width='80%' border='1' cellspacing='2' cellpadding='2'> <tr>
    <td><font face='Arial, Helvetica, sans-serif'>ID</font></td> <td><font
    face='Arial, Helvetica, sans-serif'><?php echo $row_albumdetail['albumid'];
    ?></font></td> </tr> <tr> <td><font face='Arial, Helvetica,
    sans-serif'>Album</font></td> <td><font face='Arial, Helvetica,
    sans-serif'><?php echo $row_albumdetail['albumname']; ?></font></td> </tr>
    <tr> <td><font face='Arial, Helvetica, sans-serif'>Artist</font></td>
    <td><font face='Arial, Helvetica, sans-serif'><?php echo
    $row_albumdetail['artistgroupname']; ?></font></td> </tr> <tr>
    <td><font face='Arial, Helvetica, sans-serif'>Style</font></td> <td><font
    face='Arial, Helvetica, sans-serif'><?php echo $row_albumdetail['artiststyle'];
    ?></font></td> </tr> <tr> <td><font face='Arial, Helvetica,
    sans-serif'>Artist Names</font></td> <td><font face='Arial, Helvetica,
    sans-serif'><?php echo $row_albumdetail['artistnames']; ?></font></td>
    </tr> <tr> <td><font face='Arial, Helvetica,
    sans-serif'>Notes</font></td> <td><font face='Arial, Helvetica,
    sans-serif'><?php echo $row_albumdetail['albumnotes']; ?></font></td> </tr>
    <tr> <td><font face='Arial, Helvetica, sans-serif'>Price</font></td>
    <td><font face='Arial, Helvetica, sans-serif'><?php echo
    $row_albumdetail['albumprice']; ?></font></td> </tr> <tr>
    <td><font face='Arial, Helvetica, sans-serif'>&amp;nbsp;</font></td>
    <td><font face='Arial, Helvetica, sans-serif'>&amp;nbsp;</font></td> </tr>
    </table> <p><a href='artistlistadd.php'><font face='Arial, Helvetica,
    sans-serif'>Add Artist</font></a><font face='Arial, Helvetica,
    sans-serif'> | <a href='albumadd.php'>Add Album</a> | <a
    href='artistlistadmin.php'>Artist List Admin</a></font> | <font face='Arial,
    Helvetica, sans-serif'><a href='albumadminlist.php'>Album List</a></font>
    </p> </div> </body> </html> <?php mysql_free_result($albumdetail); ?> Master
    Page code is as follows: <?php require_once('Connections/THP.php'); ?> <?php
    $maxRows_catalog = 10; $pageNum_catalog = 0; if
    (isset($HTTP_GET_VARS['pageNum_catalog'])) { $pageNum_catalog =
    $HTTP_GET_VARS['pageNum_catalog']; } $startRow_catalog = $pageNum_catalog *
    $maxRows_catalog; mysql_select_db($database_THP, $THP); $query_catalog =
    'SELECT * FROM album, artist WHERE album.artistid = artist.artistid ORDER BY
    artist.artistgroupname'; $query_limit_catalog = sprintf('%s LIMIT %d, %d',
    $query_catalog, $startRow_catalog, $maxRows_catalog); $catalog =
    mysql_query($query_limit_catalog, $THP) or die(mysql_error()); $row_catalog =
    mysql_fetch_assoc($catalog); if (isset($HTTP_GET_VARS['totalRows_catalog'])) {
    $totalRows_catalog = $HTTP_GET_VARS['totalRows_catalog']; } else {
    $all_catalog = mysql_query($query_catalog); $totalRows_catalog =
    mysql_num_rows($all_catalog); } $totalPages_catalog =
    ceil($totalRows_catalog/$maxRows_catalog)-1; ?> <html> <head> <title>Untitled
    Document</title> <meta http-equiv='Content-Type' content='text/html;
    charset=iso-8859-1'> </head> <body link='#0000FF' vlink='#0000FF'> <p
    align='center'><font size='5' face='Arial, Helvetica, sans-serif'>Album Admin
    Area </font></p> <table width='80%' border='1' align='center' cellpadding='2'
    cellspacing='2'> <tr> <td><strong><font face='Arial, Helvetica,
    sans-serif'>ID</font></strong></td> <td><strong><font face='Arial,
    Helvetica, sans-serif'>Album</font></strong></td> <td><strong><font
    face='Arial, Helvetica, sans-serif'>Artist</font></strong></td>
    <td><strong><font face='Arial, Helvetica,
    sans-serif'>Style</font></strong></td> <td><strong><font face='Arial,
    Helvetica, sans-serif'>Price</font></strong></td> <td>&amp;nbsp;</td>
    </tr> <?php do { ?> <tr> <td><font face='Arial, Helvetica,
    sans-serif'><?php echo $row_catalog['albumid']; ?>&amp;nbsp;</font></td>
    <td><font face='Arial, Helvetica, sans-serif'><a href='albumdetail.php?<?php
    echo $row_catalog['albumid']; ?>='><?php echo $row_catalog['albumname'];
    ?></a></font></td> <td><font face='Arial, Helvetica, sans-serif'><?php echo
    $row_catalog['artistgroupname']; ?></font></td> <td><font face='Arial,
    Helvetica, sans-serif'><?php echo $row_catalog['artiststyle']; ?></font></td>
    <td><font face='Arial, Helvetica, sans-serif'><?php echo
    $row_catalog['albumprice']; ?></font></td> <td><font face='Arial,
    Helvetica, sans-serif'><a href='albumadminupdate.php?<?php echo
    $row_catalog['albumid']; ?>='>Edit</a></font></td> </tr> <?php } while
    ($row_catalog = mysql_fetch_assoc($catalog)); ?> </table> <div align='center'>
    <p><a href='artistlistadd.php'><font face='Arial, Helvetica, sans-serif'>Add
    Artist</font></a><font face='Arial, Helvetica, sans-serif'> | <a
    href='albumadd.php'>Add Album</a> | <a href='artistlistadmin.php'>Artist List
    Admin</a></font></p> </div> </body> </html> <?php mysql_free_result($catalog);
    ?>

    bstanic Guest

  2. Similar Questions and Discussions

    1. Edit page shows blank page!
      We have a serious problem with Contribute 3: We browse to the page we wish to edit, and then click 'Edit'. Contribute fetches the templates etc;...
    2. Page is updated on publish but contribute shows oldversion of page
      Using Mac Contribute, it appears to be displaying cache version of page as updates to the site are published but when "publish" is pressed...
    3. Can I open a page as a popup using GOTO DETAIL PAGE
      ok, i have posted this before but i didnt get any response. I have failed to find an answer anywhere else. I want to open a GOTO DETAIL page...
    4. Detail Page ALWAYS SHOWS RECORD 1
      If it is of any use to anyone, please find the code re my previous Email above. <?php require_once('Connections/THP.php'); ?> <?php...
    5. Detail Page ALWAYS SHOWS RECORD 1
      Hi! I have the same problem (PHP MySQL). I followed the Tutorial by Matt Brown (Recordstore on Macromedia site). The only difference was, I used a...
  3. #2

    Default Re: Detail Page shows Record 1

    I can't read PHP but the usual problem is that the Master page is not
    passing across the variable to the detail page. Check the link from the mast
    page has a URL variable named exactly how you have it in the SQL on the
    detailed page.

    --
    Regards

    Paul Whitham
    Macromedia Certified Professional for Dreamweaver MX2004
    Valleybiz Internet Design
    [url]www.valleybiz.net[/url]

    Team Macromedia Volunteer for Ultradev/Dreamweaver MX
    [url]www.macromedia.com/support/forums/team_macromedia[/url]

    "bstanic" <webforumsuser@macromedia.com> wrote in message
    news:d19m6e$ps2$1@forums.macromedia.com...
    > Was working my way through Matt Brown's Tutorial (Recordstore on
    Macromedia
    > site
    >
    [url]http://www.macromedia.com/devnet/mx/dreamweaver/articles/record_store.html[/url])
    but
    > have experienced problems with the Detail page and Edit page. I used MySQL
    and
    > PHP on a Remote Server and Database. No mater what record you click on in
    the
    > Master page, it shows the same value in the detail Page i.e. the Deault
    Record.
    > When running a test on the Variable within the Recordset (Detail page), it
    > returns the Default record only. Same applies when editing a page from a
    link
    > in the Master page. When creating the Variable within the Recordset
    (Detail
    > page), the Tutorial gives the values to be input; Variable Name = colname,
    > Default = 1, and Run Time Value =$HTTP_GET_VARS['albumid']. I have
    checked,
    > rechecked and checked again to no avail. Can anyone help? Please find code
    > attached <?php require_once('Connections/THP.php'); ?> <?php
    > $colname_albumdetail = '1'; if (isset($HTTP_GET_VARS['albumid'])) {
    > $colname_albumdetail = (get_magic_quotes_gpc()) ?
    $HTTP_GET_VARS['albumid'] :
    > addslashes($HTTP_GET_VARS['albumid']); } mysql_select_db($database_THP,
    $THP);
    > $query_albumdetail = sprintf('SELECT * FROM album, artist WHERE
    album.artistid
    > = artist.artistid AND albumid = %s', $colname_albumdetail); $albumdetail =
    > mysql_query($query_albumdetail, $THP) or die(mysql_error());
    $row_albumdetail =
    > mysql_fetch_assoc($albumdetail); $totalRows_albumdetail =
    > mysql_num_rows($albumdetail); ?> <html> <head> <title>Untitled
    Document</title>
    > <meta http-equiv='Content-Type' content='text/html; charset=iso-8859-1'>
    > </head> <body link='#0000FF' vlink='#0000FF'> <div align='center'>
    <p><font
    > size='5' face='Arial, Helvetica, sans-serif'>Album Detail Page
    </font></p>
    > <table width='80%' border='1' cellspacing='2' cellpadding='2'> <tr>
    > <td><font face='Arial, Helvetica, sans-serif'>ID</font></td>
    <td><font
    > face='Arial, Helvetica, sans-serif'><?php echo
    $row_albumdetail['albumid'];
    > ?></font></td> </tr> <tr> <td><font face='Arial, Helvetica,
    > sans-serif'>Album</font></td> <td><font face='Arial, Helvetica,
    > sans-serif'><?php echo $row_albumdetail['albumname']; ?></font></td>
    </tr>
    > <tr> <td><font face='Arial, Helvetica,
    sans-serif'>Artist</font></td>
    > <td><font face='Arial, Helvetica, sans-serif'><?php echo
    > $row_albumdetail['artistgroupname']; ?></font></td> </tr> <tr>
    > <td><font face='Arial, Helvetica, sans-serif'>Style</font></td>
    <td><font
    > face='Arial, Helvetica, sans-serif'><?php echo
    $row_albumdetail['artiststyle'];
    > ?></font></td> </tr> <tr> <td><font face='Arial, Helvetica,
    > sans-serif'>Artist Names</font></td> <td><font face='Arial,
    Helvetica,
    > sans-serif'><?php echo $row_albumdetail['artistnames']; ?></font></td>
    > </tr> <tr> <td><font face='Arial, Helvetica,
    > sans-serif'>Notes</font></td> <td><font face='Arial, Helvetica,
    > sans-serif'><?php echo $row_albumdetail['albumnotes']; ?></font></td>
    </tr>
    > <tr> <td><font face='Arial, Helvetica,
    sans-serif'>Price</font></td>
    > <td><font face='Arial, Helvetica, sans-serif'><?php echo
    > $row_albumdetail['albumprice']; ?></font></td> </tr> <tr>
    > <td><font face='Arial, Helvetica, sans-serif'>&amp;nbsp;</font></td>
    > <td><font face='Arial, Helvetica, sans-serif'>&amp;nbsp;</font></td>
    </tr>
    > </table> <p><a href='artistlistadd.php'><font face='Arial, Helvetica,
    > sans-serif'>Add Artist</font></a><font face='Arial, Helvetica,
    > sans-serif'> | <a href='albumadd.php'>Add Album</a> | <a
    > href='artistlistadmin.php'>Artist List Admin</a></font> | <font
    face='Arial,
    > Helvetica, sans-serif'><a href='albumadminlist.php'>Album
    List</a></font>
    > </p> </div> </body> </html> <?php mysql_free_result($albumdetail); ?>
    Master
    > Page code is as follows: <?php require_once('Connections/THP.php'); ?>
    <?php
    > $maxRows_catalog = 10; $pageNum_catalog = 0; if
    > (isset($HTTP_GET_VARS['pageNum_catalog'])) { $pageNum_catalog =
    > $HTTP_GET_VARS['pageNum_catalog']; } $startRow_catalog = $pageNum_catalog
    *
    > $maxRows_catalog; mysql_select_db($database_THP, $THP); $query_catalog =
    > 'SELECT * FROM album, artist WHERE album.artistid = artist.artistid ORDER
    BY
    > artist.artistgroupname'; $query_limit_catalog = sprintf('%s LIMIT %d, %d',
    > $query_catalog, $startRow_catalog, $maxRows_catalog); $catalog =
    > mysql_query($query_limit_catalog, $THP) or die(mysql_error());
    $row_catalog =
    > mysql_fetch_assoc($catalog); if
    (isset($HTTP_GET_VARS['totalRows_catalog'])) {
    > $totalRows_catalog = $HTTP_GET_VARS['totalRows_catalog']; } else {
    > $all_catalog = mysql_query($query_catalog); $totalRows_catalog =
    > mysql_num_rows($all_catalog); } $totalPages_catalog =
    > ceil($totalRows_catalog/$maxRows_catalog)-1; ?> <html> <head>
    <title>Untitled
    > Document</title> <meta http-equiv='Content-Type' content='text/html;
    > charset=iso-8859-1'> </head> <body link='#0000FF' vlink='#0000FF'> <p
    > align='center'><font size='5' face='Arial, Helvetica, sans-serif'>Album
    Admin
    > Area </font></p> <table width='80%' border='1' align='center'
    cellpadding='2'
    > cellspacing='2'> <tr> <td><strong><font face='Arial, Helvetica,
    > sans-serif'>ID</font></strong></td> <td><strong><font face='Arial,
    > Helvetica, sans-serif'>Album</font></strong></td> <td><strong><font
    > face='Arial, Helvetica, sans-serif'>Artist</font></strong></td>
    > <td><strong><font face='Arial, Helvetica,
    > sans-serif'>Style</font></strong></td> <td><strong><font face='Arial,
    > Helvetica, sans-serif'>Price</font></strong></td> <td>&amp;nbsp;</td>
    > </tr> <?php do { ?> <tr> <td><font face='Arial, Helvetica,
    > sans-serif'><?php echo $row_catalog['albumid']; ?>&amp;nbsp;</font></td>
    > <td><font face='Arial, Helvetica, sans-serif'><a
    href='albumdetail.php?<?php
    > echo $row_catalog['albumid']; ?>='><?php echo $row_catalog['albumname'];
    > ?></a></font></td> <td><font face='Arial, Helvetica, sans-serif'><?php
    echo
    > $row_catalog['artistgroupname']; ?></font></td> <td><font face='Arial,
    > Helvetica, sans-serif'><?php echo $row_catalog['artiststyle'];
    ?></font></td>
    > <td><font face='Arial, Helvetica, sans-serif'><?php echo
    > $row_catalog['albumprice']; ?></font></td> <td><font face='Arial,
    > Helvetica, sans-serif'><a href='albumadminupdate.php?<?php echo
    > $row_catalog['albumid']; ?>='>Edit</a></font></td> </tr> <?php } while
    > ($row_catalog = mysql_fetch_assoc($catalog)); ?> </table> <div
    align='center'>
    > <p><a href='artistlistadd.php'><font face='Arial, Helvetica,
    sans-serif'>Add
    > Artist</font></a><font face='Arial, Helvetica, sans-serif'> | <a
    > href='albumadd.php'>Add Album</a> | <a href='artistlistadmin.php'>Artist
    List
    > Admin</a></font></p> </div> </body> </html> <?php
    mysql_free_result($catalog);
    > ?>
    >

    Paul Whitham TMM Guest

  4. #3

    Default Re: Detail Page shows Record 1

    Paul, thank you for your feedback. After looking at the problem, I sort of
    arrived at the same conclusion. Unfortunately, I am a Newbie (learning fast)
    and unable to fully understand the code. I have checked the URL Variables for
    any obvious mistakes but to no avail. I have even re-read the Tutorial a few
    times and I would appear to have followed the instructions accurately (with the
    exception of using Remote Servers and database). So I am still none the wiser,
    unfortunately. Thanks again for you input.

    bstanic Guest

  5. #4

    Default Re: Detail Page shows Record 1

    Problem Fixed. As always, it was a mistake, easy to overlook. For anyone with
    the same problem, here is what I did to rectify the problem. When creating the
    link in the Master page (to the detail page), press the Folder Icon to choose
    the file for the Detail Page, then click the Parameters button. Enter the field
    Name in the first box (in my case it was, albumid. Then tab over to the Value
    box and click the lightning Bolt and choose the Field that will be mapped to
    the name you just put in (in my case the field name was the same as the
    Parameter Name, albumid. The first mistake I made in the above was; I clicked
    the Lightning Bolt next to the Name box and chose the Field from there. This
    was obviously the wrong Bolt I clicked. When Tabbing over to the Value box, a
    new Lightning Bolt appears. This is the one you want to click to map the Field
    ID to the Parameter name. The second error I made, and mentioned by Paul, was
    'albumid' was lower case in the Master page and uppercase in the Detail page. I
    checked this so many times, I do not know how I missed it. The moral behind
    the story is; if it does not work first time, don't panic and think you have
    lost the plot. the answer will probably turn out to be something quite simple.:D

    bstanic Guest

  6. #5

    Default Re: Detail Page shows Record 1

    Just a point of reference, the second error you found, namely the difference
    in letter case is only a problem if you are running on a Unix box (which a
    lot of cheap PHP hostings are) as a windows box is not bothered by letter
    case used in this way.

    --
    Regards

    Paul Whitham
    Macromedia Certified Professional for Dreamweaver MX2004
    Valleybiz Internet Design
    [url]www.valleybiz.net[/url]

    Team Macromedia Volunteer for Ultradev/Dreamweaver MX
    [url]www.macromedia.com/support/forums/team_macromedia[/url]

    "bstanic" <webforumsuser@macromedia.com> wrote in message
    news:d1bvqb$bnr$1@forums.macromedia.com...
    > Problem Fixed. As always, it was a mistake, easy to overlook. For anyone
    with
    > the same problem, here is what I did to rectify the problem. When
    creating the
    > link in the Master page (to the detail page), press the Folder Icon to
    choose
    > the file for the Detail Page, then click the Parameters button. Enter the
    field
    > Name in the first box (in my case it was, albumid. Then tab over to the
    Value
    > box and click the lightning Bolt and choose the Field that will be mapped
    to
    > the name you just put in (in my case the field name was the same as the
    > Parameter Name, albumid. The first mistake I made in the above was; I
    clicked
    > the Lightning Bolt next to the Name box and chose the Field from there.
    This
    > was obviously the wrong Bolt I clicked. When Tabbing over to the Value
    box, a
    > new Lightning Bolt appears. This is the one you want to click to map the
    Field
    > ID to the Parameter name. The second error I made, and mentioned by Paul,
    was
    > 'albumid' was lower case in the Master page and uppercase in the Detail
    page. I
    > checked this so many times, I do not know how I missed it. The moral
    behind
    > the story is; if it does not work first time, don't panic and think you
    have
    > lost the plot. the answer will probably turn out to be something quite
    simple.:D
    >

    Paul Whitham TMM 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