Ask a Question related to Dreamweaver AppDev, Design and Development.
-
bstanic #1
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'>&nbsp;</font></td>
<td><font face='Arial, Helvetica, sans-serif'>&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>&nbsp;</td>
</tr> <?php do { ?> <tr> <td><font face='Arial, Helvetica,
sans-serif'><?php echo $row_catalog['albumid']; ?>&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
-
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;... -
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... -
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... -
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... -
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... -
Paul Whitham TMM #2
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...Macromedia> Was working my way through Matt Brown's Tutorial (Recordstore on[url]http://www.macromedia.com/devnet/mx/dreamweaver/articles/record_store.html[/url])> site
>
butand> have experienced problems with the Detail page and Edit page. I used MySQLthe> PHP on a Remote Server and Database. No mater what record you click on inRecord.> Master page, it shows the same value in the detail Page i.e. the Deaultlink> 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(Detail> in the Master page. When creating the Variable within the Recordsetchecked,> page), the Tutorial gives the values to be input; Variable Name = colname,
> Default = 1, and Run Time Value =$HTTP_GET_VARS['albumid']. I have$HTTP_GET_VARS['albumid'] :> 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()) ?$THP);> addslashes($HTTP_GET_VARS['albumid']); } mysql_select_db($database_THP,album.artistid> $query_albumdetail = sprintf('SELECT * FROM album, artist WHERE$row_albumdetail => = artist.artistid AND albumid = %s', $colname_albumdetail); $albumdetail =
> mysql_query($query_albumdetail, $THP) or die(mysql_error());Document</title>> mysql_fetch_assoc($albumdetail); $totalRows_albumdetail =
> mysql_num_rows($albumdetail); ?> <html> <head> <title>Untitled<p><font> <meta http-equiv='Content-Type' content='text/html; charset=iso-8859-1'>
> </head> <body link='#0000FF' vlink='#0000FF'> <div align='center'></font></p>> size='5' face='Arial, Helvetica, sans-serif'>Album Detail Page<td><font> <table width='80%' border='1' cellspacing='2' cellpadding='2'> <tr>
> <td><font face='Arial, Helvetica, sans-serif'>ID</font></td>$row_albumdetail['albumid'];> face='Arial, Helvetica, sans-serif'><?php echo</tr>> ?></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>sans-serif'>Artist</font></td>> <tr> <td><font face='Arial, Helvetica,<td><font> <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>$row_albumdetail['artiststyle'];> face='Arial, Helvetica, sans-serif'><?php echoHelvetica,> ?></font></td> </tr> <tr> <td><font face='Arial, Helvetica,
> sans-serif'>Artist Names</font></td> <td><font face='Arial,</tr>> 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>sans-serif'>Price</font></td>> <tr> <td><font face='Arial, Helvetica,</tr>> <td><font face='Arial, Helvetica, sans-serif'><?php echo
> $row_albumdetail['albumprice']; ?></font></td> </tr> <tr>
> <td><font face='Arial, Helvetica, sans-serif'>&nbsp;</font></td>
> <td><font face='Arial, Helvetica, sans-serif'>&nbsp;</font></td>face='Arial,> </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> | <fontList</a></font>> Helvetica, sans-serif'><a href='albumadminlist.php'>AlbumMaster> </p> </div> </body> </html> <?php mysql_free_result($albumdetail); ?><?php> Page code is as follows: <?php require_once('Connections/THP.php'); ?>*> $maxRows_catalog = 10; $pageNum_catalog = 0; if
> (isset($HTTP_GET_VARS['pageNum_catalog'])) { $pageNum_catalog =
> $HTTP_GET_VARS['pageNum_catalog']; } $startRow_catalog = $pageNum_catalogBY> $maxRows_catalog; mysql_select_db($database_THP, $THP); $query_catalog =
> 'SELECT * FROM album, artist WHERE album.artistid = artist.artistid ORDER$row_catalog => 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());(isset($HTTP_GET_VARS['totalRows_catalog'])) {> mysql_fetch_assoc($catalog); if<title>Untitled> $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>Admin> 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'>Albumcellpadding='2'> Area </font></p> <table width='80%' border='1' align='center'href='albumdetail.php?<?php> 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>&nbsp;</td>
> </tr> <?php do { ?> <tr> <td><font face='Arial, Helvetica,
> sans-serif'><?php echo $row_catalog['albumid']; ?>&nbsp;</font></td>
> <td><font face='Arial, Helvetica, sans-serif'><aecho> echo $row_catalog['albumid']; ?>='><?php echo $row_catalog['albumname'];
> ?></a></font></td> <td><font face='Arial, Helvetica, sans-serif'><?php?></font></td>> $row_catalog['artistgroupname']; ?></font></td> <td><font face='Arial,
> Helvetica, sans-serif'><?php echo $row_catalog['artiststyle'];align='center'>> <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> <divsans-serif'>Add> <p><a href='artistlistadd.php'><font face='Arial, Helvetica,List> Artist</font></a><font face='Arial, Helvetica, sans-serif'> | <a
> href='albumadd.php'>Add Album</a> | <a href='artistlistadmin.php'>Artistmysql_free_result($catalog);> Admin</a></font></p> </div> </body> </html> <?php> ?>
>
Paul Whitham TMM Guest
-
bstanic #3
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
-
bstanic #4
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
-
Paul Whitham TMM #5
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...with> Problem Fixed. As always, it was a mistake, easy to overlook. For anyonecreating the> the same problem, here is what I did to rectify the problem. Whenchoose> link in the Master page (to the detail page), press the Folder Icon tofield> the file for the Detail Page, then click the Parameters button. Enter theValue> Name in the first box (in my case it was, albumid. Then tab over to theto> box and click the lightning Bolt and choose the Field that will be mappedclicked> 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; IThis> the Lightning Bolt next to the Name box and chose the Field from there.box, a> was obviously the wrong Bolt I clicked. When Tabbing over to the ValueField> new Lightning Bolt appears. This is the one you want to click to map thewas> ID to the Parameter name. The second error I made, and mentioned by Paul,page. I> 'albumid' was lower case in the Master page and uppercase in the Detailbehind> checked this so many times, I do not know how I missed it. The moralhave> the story is; if it does not work first time, don't panic and think yousimple.:D> lost the plot. the answer will probably turn out to be something quite>
Paul Whitham TMM Guest



Reply With Quote

