IanMc Posted March 9, 2015 Share Posted March 9, 2015 Creating a dynamic web site in Dreamweaver following a David Powers tutorial at Building your first dynamic website – Part 2: Developing the back end | Adobe Developer Connection One stage is to create edit and delete links. I select EDIT from the page that lists all records in the database (manage_posts.php in tutorial, update_benefactions_record.php in my database) Select URL from Select File box, click on Parameters from File box, enter the primary key of the records in the Name box. Click on Value lightning bolt. Dreamweaver totally locks up. Need to use Task Manager to close it down and regain control. What it should do is insert a line in the page's code - <td><a href="update_benefactions_record.php?be_index=<?php echo $row_rsBenefactions[`be_index`];?>">EDIT</a></td> (rsBenefactions is the name of the relevant recordset) Since trying to insert this code via the DW facility locks everything up, I tried entering the line by hand. According to the tutorial what this should do is select the appropriate record from the record listing table and show the entire record in the updating page. i.e If I select say the 3rd record, using Live view I should see the code <td><a href="update_benefactions_record.php?be_index=3">EDIT</a><</td> Unfortunately I don't, so I am completely stalled. As you will have gathered I am a newby to MySQLi and PHP so am dependent on following these tutorials (modifying them to my needs - a data management site for the local church). Quote Link to comment Share on other sites More sharing options...
requinix Posted March 9, 2015 Share Posted March 9, 2015 What does "locks everything up" mean? What does the HTML source of the page (ie, browser's View Source) show for the link? Quote Link to comment Share on other sites More sharing options...
IanMc Posted March 9, 2015 Author Share Posted March 9, 2015 Locks everything up = basically the computer won't work. No keys will function within Dreamweaver and I can't Alt-Tab to any other software I may have running. The only option I have is to use Ctrl-Alt-Del to access Dreamweaver and shut it down. The live code is <td width="80" align="center" valign="top"><strong> <a href="update_furniture_record.php?fu_index=<br /> <b>Notice</b>: Undefined variable: row_rsFurniture in <b>D:\xampp\htdocs\priory_database\terrier\admin\furniture\list_furniture_record.php</b> on line <b>61</b><br />">EDIT</a></strong></td> The undefined variable it refers to I assume is the result of the <td><a href="update_benefactions_record.php?be_index=<?php echo $row_rsBenefactions[`be_index`];?>">EDIT</a></td> failing to return the record number it should return. Quote Link to comment Share on other sites More sharing options...
requinix Posted March 9, 2015 Share Posted March 9, 2015 Locks everything up = basically the computer won't work. No keys will function within Dreamweaver and I can't Alt-Tab to any other software I may have running. The only option I have is to use Ctrl-Alt-Del to access Dreamweaver and shut it down.Well, that's Dreamweaver's fault. The live code isActually, how about posting the full PHP code to the entire file? This pointy-clicky bull with Dreamweaver just doesn't cut it. 1 Quote Link to comment Share on other sites More sharing options...
IanMc Posted March 9, 2015 Author Share Posted March 9, 2015 Sorry - the live code I quoted was from another section of the database - re furniture rather than benefactions - but the results are the same. Quote Link to comment Share on other sites More sharing options...
IanMc Posted March 9, 2015 Author Share Posted March 9, 2015 (edited) The code for the full page is below. Only Edit has the faulty code so far. Not much point in adding it to Vew & Delete since it doesn't work. <?php require_once('../../../Connections/PrioryTerrier.php'); ?> <?php require_once('../../../webassist/mysqli/rsobj.php'); ?> <?php $rsBenefactions = new WA_MySQLi_RS("rsBenefactions",$PrioryTerrier,5); $rsBenefactions->setQuery("SELECT * FROM benefactions ORDER BY be_recipient ASC"); $rsBenefactions->execute(); ?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "[url=http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd]http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">[/url] <html xmlns="[url=http://www.w3.org/1999/xhtml]http://www.w3.org/1999/xhtml">[/url] <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>Terrier - Add Furniture Record</title> <link href="../../../_css/master.css" rel="stylesheet" type="text/css" /> </head> <body> <div id="header"> <h1 align="center" class="header">The Priory Church of St Mary and St Bega</h1> <h2 align="center">Priory Terrier</h2> <div id="topbar"> <div align="center"> <h4>Benefactions</h4> </div> <!-- end #topbar --> </div> <!-- end #header --> </div> <table width="1000" border="0" align="center" cellspacing="10"> <tr> <td width="150" align="left" valign="top"> <a href="../../../index.php" class="navText">Home</a> <p></p> <a href="../index.php" class="navText">Terrier Documentation</a> <a href="../furniture/list_furniture_record.php" class="navText">Buildings & Grounds</a> <a href="list_benefactions_record.php" class="navText">Benefactions</a> <a href="../registers/list_registers_record.php" class="navText">Registers & Records</a> <a href="../plate/list_plate_record.php" class="navText">Church Plate</a> <a href="../furniture/list_furniture_record.php" class="navText">Furnishings and Fittings</a> <p> </p> </td> <td rowspan="3" align="left" valign="top"> <h3>Add new record</h3> <table width="800" border="1"> <tr> <td width="230" align="left" valign="top"><strong>Recipient</strong></td> <td width="230" align="left" valign="top"><strong>Purpose</strong></td> <td width="230" align="left" valign="top"><strong>Description</strong></td> <td width="80" align="center" valign="top"> </td> <td width="80" align="center" valign="top"> </td> <td width="80" align="center" valign="top"> </td> </tr> <?php while(!$rsBenefactions->atEnd()) { ?> <tr> <td width="230" align="left" valign="top"><?php echo($rsBenefactions->getColumnVal("be_recipient")); ?></td> <td width="230" align="left" valign="top"><?php echo($rsBenefactions->getColumnVal("be_purpose")); ?></td> <td width="230" align="left" valign="top"><?php echo($rsBenefactions->getColumnVal("be_nature")); ?></td> <td width="80" align="center" valign="top">View</td> <td width="80" align="center" valign="top"> <a href ="update_benefactions_record.php?be_index=<?php echo $row_rsBenefactions[`be_index`]; ?>">EDIT</a></td> <td width="80" align="center" valign="top">Delete</td> </tr> <?php $rsBenefactions->moveNext(); } $rsBenefactions->moveFirst(); //return RS to first record ?> </table> <table border="0" align="center"> <tr> <td><a href="<?php echo $rsBenefactions->getFirstPageLink(); ?>">First</a></td> <td><a href="<?php echo $rsBenefactions->getPrevPageLink(); ?>">Previous</a></td> <td><a href="<?php echo $rsBenefactions->getNextPageLink(); ?>">Next</a></td> <td><a href="<?php echo $rsBenefactions->getLastPageLink(); ?>">Last</a></td> </tr> </table> <div class="container"> </div> </tr> <tr> <td align="left" valign="top"> </td> </tr> </table> <div id="copyright"> <h6 class="copyright">Copyright 2013 - Ian McAndrew & St Bees Priory Church, St Bees, Cumbria.</h6> <!-- end #container --> </div> </body> </html> Edited March 9, 2015 by requinix please use [code] tags when posting code Quote Link to comment Share on other sites More sharing options...
requinix Posted March 9, 2015 Share Posted March 9, 2015 (edited) Take a look at how the recipient, purpose, and description make their way into the HTML: <td width="230" align="left" valign="top"><?php echo($rsBenefactions->getColumnVal("be_recipient")); ?></td> <td width="230" align="left" valign="top"><?php echo($rsBenefactions->getColumnVal("be_purpose")); ?></td> <td width="230" align="left" valign="top"><?php echo($rsBenefactions->getColumnVal("be_nature")); ?></td>It's not particularly good (shakes fist at Dreamweaver) but you need to mirror what it does with $rsBenefactions in your own code. Optionally mirroring the style too: <?php echo($rsBenefactions->getColumnVal("be_index")); ?>You also cannot use smart quotes in code. Probably Dreamweaver's fault again (continues shaking fist). Edited March 9, 2015 by requinix Quote Link to comment Share on other sites More sharing options...
Solution IanMc Posted March 10, 2015 Author Solution Share Posted March 10, 2015 Problem solved so now I can move on - many thanks. Do I get the feeling you don't like Dreamweaver? I can understand why as the code I was using was lifted from an Adobe DW tutorial. And yes, smart quotes came from that too. I'll try to learn PHP better but at 75 it's hard work! Apologies for wrongly posting code without code tags. Ian Quote Link to comment Share on other sites More sharing options...
requinix Posted March 10, 2015 Share Posted March 10, 2015 (edited) Yeah... I don't really care for Dreamweaver. I could go on a long rant about it (no, really) and other things like it, but suffice it to say: I don't like the habits it teaches. Which is not to say anything about you. Showing initiative is a good thing and everybody has to start somewhere. Edited March 10, 2015 by requinix Quote Link to comment Share on other sites More sharing options...
IanMc Posted March 15, 2015 Author Share Posted March 15, 2015 I would agree with the principle you are preaching - like painting by numbers. Whatever skill you learn, you should learn it from the basics up. However things change with age and some things, such as this project, is something I can just about manage using the "painting by numbers" approach. At my age, while I may have the desire to learn PHP properly, I have neither the time nor need to do so. There are too many other things I want to do. As for this project, the only reason I have taken it on is to save St Bees Priory (stbees. org. uk / churches/priory) £5,000 - the cost of a commercial package on offer to churches. Mine is not as good, not as pretty nor as comprehensive, but it does what the Priory needs! The commercial product is probably worth the money, but the church does not have it! Hopefully I won't get stuck again, but if I do, I hope you will help again. Many thanks. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.