Linking Recordset in Dreamweaver

Hi
To better explain my problem and hopefully find a solution, here is a backstory.
I am building a database driven website with PHP and MySQL using Dreamweaver CS5.
One of the pages on site is called programme, and it access by query string like this
www.domain.com/programme/?id=10000000
Depending on the value of the query string, programme data is retrieved from the database and is displayed on the page. All this is working without any problems.
In addition to the main programme information, I also want to display related ‘programmes’ on the bottom of the page.
To achieve this I have created two ‘record sets’ in Dreamweaver.
The first recordset retrieves the main programme and the second recordset will retrieves the related programmes.
These are the fields in the database.
Id, programme, episode, date, time
Recordset 1 : SQL
PHP Code:
$programme_Programme = "-1";
if (isset($_GET['id'])) {
  $programme_Programme = $_GET['id'];
mysql_select_db($database_main, $main);
$query_Programme = sprintf("SELECT * FROM main WHERE id = %s", GetSQLValueString($programme_Programme, "int"));
$Programme = mysql_query($query_Programme, $main) or die(mysql_error());
$row_Programme = mysql_fetch_assoc($Programme);
$totalRows_Programme = mysql_num_rows($Programme);
I have had great difficulty in the SQL for the second recordsets. 
I think the solution involves in taking $programme defined in first recodset and using in the second recordset SQL somehow.
Something like
PHP Code:
$related_Related = "-1";
if (isset($_GET['programme'])) {
  $related_Related = $_GET['programme'];
mysql_select_db($database_main, $main);
$query_Related = sprintf("SELECT * FROM main WHERE %s = programme", GetSQLValueString($related_Related, "text"));
$Related = mysql_query($query_Related, $main) or die(mysql_error());
$row_Related = mysql_fetch_assoc($Related);
$totalRows_Related = mysql_num_rows($Related);
But, this does not work. 
I know this is totally messed-up
So I would really appreciate if someone can let me know what I should be doing to get this to work.
Thanks

Thanks for that, but am afraid it did not work
I just get syntax error, not in Dreamweaver but when I try to load the page.
This is the message
You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'Cut' at line 1
The first record in my table contains the word 'Cut', so I thought that was the problem.
I then decided to change the name of the first record to progamme and hey presto no syntax error.
It seems like this codes works only if the record name is programme.
What I wanted to achieve was a way of taking the name of the programme retrieved in the first recordset and using it to look up the programme field for other "related" programmes.
Here is the code as it stands
$programme_Programme = "-1";
if (isset($_GET['id'])) {
  $programme_Programme = $_GET['id'];
mysql_select_db($database_main, $main);
$query_Programme = sprintf("SELECT * FROM main WHERE id = %s", GetSQLValueString($programme_Programme, "int"));
$Programme = mysql_query($query_Programme, $main) or die(mysql_error());
$row_Programme = mysql_fetch_assoc($Programme);
$totalRows_Programme = mysql_num_rows($Programme);
$programme = $row_Programme['programme'];
$maxRows_Related = 2;
$pageNum_Related = 0;
if (isset($_GET['pageNum_Related'])) {
  $pageNum_Related = $_GET['pageNum_Related'];
$startRow_Related = $pageNum_Related * $maxRows_Related;
mysql_select_db($database_main, $main);
$query_Related = "SELECT * FROM main WHERE programme  = $programme";
$query_limit_Related = sprintf("%s LIMIT %d, %d", $query_Related, $startRow_Related, $maxRows_Related);
$Related = mysql_query($query_limit_Related, $main) or die(mysql_error());
$row_Related = mysql_fetch_assoc($Related);
if (isset($_GET['totalRows_Related'])) {
  $totalRows_Related = $_GET['totalRows_Related'];
} else {
  $all_Related = mysql_query($query_Related);
  $totalRows_Related = mysql_num_rows($all_Related);
$totalPages_Related = ceil($totalRows_Related/$maxRows_Related)-1;

Similar Messages

  • Unable to Create New RecordSet in Dreamweaver 8

    Hi,
    I'm new to databases. I'm trying to create a RecordSet using
    Dreamweaver 8. When I go to the Bindings panel and click the "+"
    sign and choose RecordSet, I name the RecordSet, I choose a
    connection, but there are no tables and the setup dialog box needs
    me to choose a table to create a RecordSet.
    The problem is when I try to create a dynamic table, I get an
    error stating that a cannot create the table without first creating
    a RecordSet. Worse, I cannot create a RecordSet without first
    creating a table. I'm stuck! How do I create the two if one cannot
    exist without the other?
    Yes, I have successfully connected to my testing server.

    First of all .. what server model? what database are you
    using?
    There are tables and there are tables. The "tables" you
    should see when
    creating a recordset are database tables. If you don't see
    them in the
    recordset window .. what is your connection string? Or is
    this a DSN?
    the "dynamic table" on the other hand is a table on your page
    created from
    the recordset and is not the same thing as the tables you see
    from your
    database. I wanted to make sure you knew the difference.
    Nancy Gill
    Adobe Community Expert
    Author: Dreamweaver 8 e-book for the DMX Zone
    Co-Author: Dreamweaver MX: Instant Troubleshooter (August,
    2003)
    Technical Editor: Dreamweaver CS3: The Missing Manual,
    DMX 2004: The Complete Reference, DMX 2004: A Beginner's
    Guide
    Mastering Macromedia Contribute
    Technical Reviewer: Dynamic Dreamweaver MX/DMX: Advanced PHP
    Web Development
    "sandisi" <[email protected]> wrote in
    message
    news:fkbuqt$pnd$[email protected]..
    > Hi,
    > I'm new to databases. I'm trying to create a RecordSet
    using Dreamweaver
    > 8.
    > When I go to the Bindings panel and click the "+" sign
    and choose
    > RecordSet, I
    > name the RecordSet, I choose a connection, but there are
    no tables and the
    > setup dialog box needs me to choose a table to create a
    RecordSet.
    >
    > The problem is when I try to create a dynamic table, I
    get an error
    > stating
    > that a cannot create the table without first creating a
    RecordSet. Worse,
    > I
    > cannot create a RecordSet without first creating a
    table. I'm stuck! How
    > do I
    > create the two if one cannot exist without the other?
    >
    > Yes, I have successfully connected to my testing server.
    >

  • Problem Creating Recordset in Dreamweaver CS5.5

    Can you help?
    I am having with recordsets in Dreamweaver CS5.5, or rather the sudden (I don’t know why this has suddenly happened) inability to create one. 
    When I try to create a recordset query I get this error message and am prevented from creating said recordset -
    While executing onBlur in ServerBeh-PHP-SimpRS.htm the following javascript
    error occured:
    In file ServerBeh-PHP-SimpRS
    Update UI is not defined
    I have tried re-installign Dreamwear to no avail

    This worked for me.
    Step One
    Remote Server Settings
    Server Name: *Insert Name
    Connect using: FTP
    FTP Address: yourdomain.com
    Username: yourusername
    Password: yourpassword
    Root:
    Web URL: http://yourdomain.com
    Step Two
    Testing Server Settings
    Server Name: *Insert Name
    Connect using: FTP
    FTP Address: yourdomain.com
    Username: yourusername
    Password: yourpassword
    Root:
    Web URL: http://yourdomain.com
    Click on the Advanced tab
    Testing server
    Server Model: PHP MySQL
    Step Three (this is the tricky part, lol)
    Click on file, then click New.
    Create a NEW, I repeat... NEW PHP page.
    Let it sit.
    Step Four
    Now enter your remote SQL settings.
    Not sure why... but this worked for me after HOURS of:
    "An unidentified error has occurred"

  • All the links to download DREAMWEAVER CS3 Creative Suite are not working. How can I download the file ? I have a serial number of a purchased software.

    All the links to download DREAMWEAVER CS3 Creative Suite are not working. How can I download the file ? I have a serial number of a purchased software.

    They work just fine. whatever issues you have are specific, but without proper system info, browser info and other details nobody can even begin to guess.
    Mylenium

  • If I set Firefox as my default web browser, the help links on Adobe Dreamweaver and Flash's welcome screens don't connect to the help pages on Adobe's site. It just links to Firefox's start page and stops. The links work properly if Safari is set to the d

    If I set Firefox as my default web browser, the help links on Adobe Dreamweaver and Flash's welcome screens don't connect to the help pages on Adobe's site. It just links to Firefox's start page and stops. The links work properly if Safari is set to the default browser. Please help.
    == URL of affected sites ==
    http://www.adobe.com

    Hello,
    Many site issues can be caused by corrupt cookies or cache. In order to try to fix these problems, the first step is to clear both cookies and the cache.
    Note: ''This will temporarily log you out of all sites you're logged in to.''
    To clear cache and cookies do the following:
    #Go to Firefox > History > Clear recent history or (if no Firefox button is shown) go to Tools > Clear recent history.
    #Under "Time range to clear", select "Everything".
    #Now, click the arrow next to Details to toggle the Details list active.
    #From the details list, check ''Cache'' and ''Cookies'' and uncheck everything else.
    #Now click the ''Clear now'' button.
    Further information can be found in the [[Clear your cache, history and other personal information in Firefox]] article.
    Did this fix your problems? Please report back to us!
    Thank you.

  • Any help / link to purchase dreamweaver and photoshop license permanently? not monthly, yearly!

    Any help / link to purchase dreamweaver and photoshop license permanently? not monthly, yearly!

    CS6 Direct Downloads
    Be sure to follow the VERY IMPORTANT INSTRUCTIONS or it won't work.
    http://prodesigntools.com/adobe-cs6-direct-download-links.html
    CS6 Purchase
    http://www.adobe.com/products/catalog/cs6._sl_id-contentfilter_sl_catalog_sl_software_sl_c reativesuite6.html
    Nancy O.

  • Linking PDF to Dreamweaver

    Im trying to link a .pdf to my Dreamweaver document so that readers can view online.  I added the .pdf as an asset in Dreamweaver and linked it just as I would any other link.  However when I view it I get this message:
    "The Adobe Acrobat/Reader that is running can not be used to view PDF files in a Web Browser.  Please exit Adobe Acrobat/Reader and exit your web browser and try again."
    I do not have Acrobat or Reader open!  Does anyone know what is going on?  Or even better, can someone explain how I can publish a .pdf on my website so that when the page is visited it automatically appears without having to click on another link.
    Thanks for the help.

    A good question.
    Asking at the Dreamweaver forum may elicit a more useful set of replies.
    http://forums.adobe.com/community/dreamweaver
    Be well...

  • Image Link Problem with Dreamweaver CS4?

    On my website, I have several images that link to other parts on my website. These work no problem when I preview the site, but after I test the links, the images that had those links have purple outlines that really clash with my website's design. Will users see this if they click on my links, and then return to the page? I'm using CS4 right now, and never recalled having this issue come up when using MX. Thanks for the help.

    I got stuck on this one too - not realising that Dreamweaver automatically palces a border on every image link - but the simplest way I found was to have my "Properties" panel showing on the bottom and input 0 into the "Border" box. By having this panel open you can see if you have accidently applied any styles to the image, where it links to, Image size attributes and the Image name.

  • Links Problem in Dreamweaver CS3 !

    I recently reinstalled my Dreamweaver CS3. Now everytime i save a file, it saves the whole directory path with the file name. So when i opened my index page and saved it with some changes, all my css tables have been lost. and all the links in the file are relative to my system directory.
    BEFORE, it was index.html
    AFTER SAVE, it is "C:\Documents and Settings\Idiot User\index.html"
    this has happened to EACH link that i used in my page, so even the css stylesheet is not working.
    the entire website appears perfectly in Dreamweaver, but when i upload the files to my webspace, the links link to "file:///C|/Documents%20and%20Settings/Delvin/My%20Documents/CBPC%20Website/sermons.html" , for example.
    also when i change the links, image locations to the File-only, and remove the directory bit, the images disappear in dreamweaver.
    Everything was working perfectly, until i re-installed the program. Can anyone suggest a way in which every file and every link is synced; so it is what it says it is WYSIWYG !

    i do NOT think that it is a helpful answer .
    You may not think so, but it sounds like a very plausible explanation and a mighty good place to start looking.
    In your site definition settings, are your links relative to Document or Site Root?
    Which operating system are you using?
    Did you get all the latest updates for CS3 since re-installing?
    Nancy O.
    Alt-Web Design & Publishing
    Web | Graphics | Print | Media  Specialists
    www.alt-web.com/
    www.twitter.com/altweb

  • PDF link issue in Dreamweaver

    Clicking on PDF links in Dreamweaver brings up an Adobe PDF error that says: "There is a problem with Adobe Acrobat. If it is running, please exit and try again. (1:1)". We tried reinstalling to the latest version of Acrobat X but the error continues.
    We thought this was an Acrobat error, however PDFs function normally so long as they are not called out from Dreamweaver. We have tried reinstalling Dreamweaver with no luck as well.
    Any ideas?
    Thanks!
    Machine is Windows 7 with Dreamweaver CS5 v6 and Acrobat X.

    OK, why do you want to preview/open a PDF from within Dreamweaver?
    Added new content which includes the pdf link to my web page and need to ensure the link works before going live with the web page.
    You should be able to do so while in Live View, but I would not expect this to work in just Design View in any version of Dreamweaver.
    Before received Dreamweaver upgrade, I previewed the web page in the web browser and clicked the links on page to verify if worked and no problem. I should be able to continue to do so now.
    If you are just trying to test out what the experience would be like for the visitors to your website, then you should be doing so in a web browser. e.g. use Preview In Browser from Dreamweaver, then click the link for the PDF from within your browser.
    I agree, as previously stated, this is what I'm doing and it's not working......the pdf file does not open.

  • Links open in Dreamweaver rather than browser

    Hi. For some reason any link I open in Adobe Flash or Air
    apps will open in Dreamweaver and not my browser. Windows XP. These
    are apps that have opened in the browser in the past. Seems like a
    setting issue

    Sounds like you have Dreamweaver registered as your default
    browser.
    Oliver Goldman | Adobe AIR Engineering

  • Linking PDFs in Dreamweaver

    I'm wanting to link a .pdf into a Dreamweaver web page so that readers can view it online.
    Does anyone know how I can do this or if it's possible? Ideally, I would really like to publish a .pdf on my website so that when the page is visited it automatically appears without having to click on another link. I have searched everywhere I can think of in numerous ways and keep coming up empty!
    Thanks in advance  for any help you can give me!

    You really have no control over how people view their PDFs locally.
    It's dependent on local user settings. You hardly ever see embedded PDFs on web pages because there's no guarantee that they'll work as you intend.
    This is currently done in Publisher and then converted to a PDF. They don't want to have to teach their members about downloading plug-ins.
    If you know of another program they can use to develope a newsletter that can be printed, put in an e-mail, and published on a web site that doesn't require conversion to PDF -- I and they would love the answer to that as well!
    Most people already have a PDF viewer (such as Acrobat Reader) installed so a link to a PDF is usually all that is required.
    It's the lowest maintenance, and most widely used, option without requiring lots of instructions.
    If you want to research alternative approaches, which version of Publisher is being used?
    You can export Publisher documents as self-contained websites which can then be uploaded.
    However I suspect most people would prefer reading a PDF which looks familiar and they can print.

  • Linking PDFs with Dreamweaver

    I'm wanting to link a .pdf into a Dreamweaver web page so that readers can view it online. 
    Does anyone know how I can do this or if it's possible? Ideally, I would really like to publish a .pdf on my website so that when the page is visited it automatically appears without having to click on another link. I have searched everywhere I can think of in numerous ways and keep coming up empty!
    Thanks in advance  for any help you can give me!

    Like Mike mentioned already, best to ask in the dreamweaver forum.
    But you'll have two choices. You can simply link to the PDF and for many, it will open in their browser. For some, it will prompt to download the file so they can open in Reader or Acrobat (or whatever they use to view PDF's).
    You can also "embed" the PDF in the page so it shows on a page. The only time you want to do this is when you have other elements on the page that you want them to see at the same time.
    Again, you'll want to ask any further questions in the Dreamweaver forum.
    http://forums.adobe.com/community/dreamweaver/dreamweaver_general

  • Linking pages on dreamweaver

    in creating a website on dreamweaver for a project. it isnt
    going on line. how do i link up my pages?

    You're welcome.
    Murray --- ICQ 71997575
    Adobe Community Expert
    (If you *MUST* email me, don't LAUGH when you do so!)
    ==================
    http://www.projectseven.com/go
    - DW FAQs, Tutorials & Resources
    http://www.dwfaq.com - DW FAQs,
    Tutorials & Resources
    ==================
    "Ken Binney" <[email protected]> wrote
    in message
    news:ggosrn$cs3$[email protected]..
    > Thanks as ever Murray
    >
    >
    >
    > "Murray *ACE*" <[email protected]>
    wrote in message
    > news:ggos4b$c19$[email protected]..
    >> Maybe not. Root relative links will not work
    offline.
    >>
    >> --
    >> Murray --- ICQ 71997575
    >> Adobe Community Expert
    >> (If you *MUST* email me, don't LAUGH when you do
    so!)
    >> ==================
    >>
    http://www.projectseven.com/go
    - DW FAQs, Tutorials & Resources
    >>
    http://www.dwfaq.com - DW FAQs,
    Tutorials & Resources
    >> ==================
    >>
    >>
    >> "Ken Binney"
    <[email protected]> wrote in message
    >> news:ggoro3$bhd$[email protected]..
    >>> Either relative or root relative links will work
    fine.
    >>>
    >>>
    >>> "086kerry" <[email protected]>
    wrote in message
    >>> news:ggopt6$9e3$[email protected]..
    >>>> in creating a website on dreamweaver for a
    project. it isnt going on
    >>>> line. how do i link up my pages?
    >>>
    >>>
    >>
    >
    >

  • Site root links problem in Dreamweaver CS3

    I am having trouble with links relative to site root when I
    work on my localhost with Dreamweaver CS3.
    I am building a site with PHP, MySQL using the WAMP server. I
    have a page ( www.site.com/index.php ) that I want to copy to
    sub-directories (e.g. www.site.com/about/index.php ) so I want to
    make the copying as painless as possible by using site root
    relative links (e.g. /about/index.php ). It works on the internet
    but NOT on localhost.
    Why is this? What can be done? Is there a fix if this is a
    bug? This seems like such a simple thing but it is such a
    problem.

    > Why is this?
    Because when your (local) webserver see's that you are
    directing it to the
    ROOT, it goes to ITS root, not the website's root (e.g.,
    htdocs or Inetpub).
    You can get around this by using virtual hosts (google it).
    Murray --- ICQ 71997575
    Adobe Community Expert
    (If you *MUST* email me, don't LAUGH when you do so!)
    ==================
    http://www.projectseven.com/go
    - DW FAQs, Tutorials & Resources
    http://www.dwfaq.com - DW FAQs,
    Tutorials & Resources
    ==================
    "KBwebpro" <[email protected]> wrote in
    message
    news:fr6g48$gs4$[email protected]..
    >I am having trouble with links relative to site root when
    I work on my
    > localhost with Dreamweaver CS3.
    >
    > I am building a site with PHP, MySQL using the WAMP
    server. I have a page
    > (
    > www.site.com/index.php ) that I want to copy to
    sub-directories (e.g.
    > www.site.com/about/index.php ) so I want to make the
    copying as painless
    > as
    > possible by using site root relative links (e.g.
    /about/index.php ). It
    > works
    > on the internet but NOT on localhost.
    >
    > Why is this? What can be done? Is there a fix if this is
    a bug? This
    > seems
    > like such a simple thing but it is such a problem.
    >

Maybe you are looking for