close ad
WARNING: Do Not Install the DREAMWEAVER CC 2017 or 2018 Update »
open ad
View Menu

Technical Support Forums

Free, outstanding support from WebAssist and your colleagues

rating

Help with repeating table wizard

Thread began 8/12/2010 2:03 pm by iainmacdonald331081 | Last modified 8/12/2010 6:16 pm by iainmacdonald331081 | 592 views | 3 replies |

iainmacdonald331081

Help with repeating table wizard

As a follow up to my other thread, I'm now trying to recreate the grid layout DA created when I originally ran it to create the results page for a table of Destinations :

destinationstemp.php

(One issue there is the images extending beyond 182px wide, even though I've specified a width for the image. But that's less of a concern just now - I can add in some code to fix that that I've used in the past).

I also have the page for tour package details, which now pulls through the destinations linked to the selected tour package.

So I'm just trying to replicate the grid layout in the page above on this page :

packageDetailsTest3.php?packageID=140

I just tried using DA's Repeating Table wizard, but when I fired it up, it couldn't see any recordset to work with.

I assume its something to do with the way the code is at the top of the page - Dreamweaver doesn't seem to see it either, in its database server behaviours panel.

At the moment all of that looks like :

php:
<?php require_once('Connections/connPackages.php'); ?>

<?php
if (!function_exists("GetSQLValueString")) {
function 
GetSQLValueString($theValue$theType$theDefinedValue ""$theNotDefinedValue ""
{
  if (
PHP_VERSION 6) {
    
$theValue get_magic_quotes_gpc() ? stripslashes($theValue) : $theValue;
  }

  
$theValue function_exists("mysql_real_escape_string") ? mysql_real_escape_string($theValue) : mysql_escape_string($theValue);

  switch (
$theType) {
    case 
"text":
      
$theValue = ($theValue != "") ? "'" $theValue "'" "NULL";
      break;    
    case 
"long":
    case 
"int":
      
$theValue = ($theValue != "") ? intval($theValue) : "NULL";
      break;
    case 
"double":
      
$theValue = ($theValue != "") ? doubleval($theValue) : "NULL";
      break;
    case 
"date":
      
$theValue = ($theValue != "") ? "'" $theValue "'" "NULL";
      break;
    case 
"defined":
      
$theValue = ($theValue != "") ? $theDefinedValue $theNotDefinedValue;
      break;
  }
  return 
$theValue;
}
}
?>
<?php
if (!session_id()) session_start(); 
?>
<?php
$ParampackageID_WADApackages 
"-1";
if (isset(
$_GET['packageID'])) {
  
$ParampackageID_WADApackages = (get_magic_quotes_gpc()) ? $_GET['packageID'] : addslashes($_GET['packageID']);
}
$ParamSessionpackageID_WADApackages "-1";
if (isset(
$_SESSION['WADA_Insert_packages'])) {
  
$ParamSessionpackageID_WADApackages = (get_magic_quotes_gpc()) ? $_SESSION['WADA_Insert_packages'] : addslashes($_SESSION['WADA_Insert_packages']);
}
$ParampackageID2_WADApackages "-1";
if (isset(
$_GET['packageID'])) {
  
$ParampackageID2_WADApackages = (get_magic_quotes_gpc()) ? $_GET['packageID'] : addslashes($_GET['packageID']);
}
mysql_select_db($database_connPackages$connPackages);

$query_WADApackages sprintf("SELECT packageID, package, costperpax, duration, baselocation, category, dateadded, agerange, hotel, educational_tours, field_trips, corporate_outings, plant_visits, budget_package, rollingtours, teambuilding, description, offer FROM packages WHERE packageID = %s OR ( -1= %s AND packageID= %s)"GetSQLValueString($ParampackageID_WADApackages"int"),GetSQLValueString($ParampackageID2_WADApackages"int"),GetSQLValueString($ParamSessionpackageID_WADApackages"int"));
$WADApackages mysql_query($query_WADApackages$connPackages) or die(mysql_error());
$row_WADApackages mysql_fetch_assoc($WADApackages);
$totalRows_WADApackages mysql_num_rows($WADApackages);

$colname_WADAdestinations "1";
if (isset(
$_GET['packageID'])) {
  
$colname_WADAdestinations = (get_magic_quotes_gpc()) ? $_GET['packageID'] : addslashes($_GET['packageID']);
}
mysql_select_db($database_connPackages$connPackages);
$query_WADAdestinations sprintf("SELECT * FROM destinations INNER JOIN (packages INNER JOIN packagedestinations ON packages.packageID = packagedestinations.packageID) ON destinations.destinationID = packagedestinations.destinationID WHERE packages.packageID = %s ORDER BY destination ASC"GetSQLValueString($colname_WADAdestinations"int"));
$WADAdestinations mysql_query($query_WADAdestinations$connPackages) or die(mysql_error());
$row_WADAdestinations mysql_fetch_assoc($WADAdestinations);
$totalRows_WADAdestinations mysql_num_rows($WADAdestinations);$colname_WADAdestinations "1";
if (isset(
$_GET['packageID'])) {
  
$colname_WADAdestinations = (get_magic_quotes_gpc()) ? $_GET['packageID'] : addslashes($_GET['packageID']);
}
?>



Any ideas what's going on with the recordset? Or if it only exists as a query how to make it appear as a recordset?

Sign in to reply to this post

iainmacdonald331081

OK - I redid the recordset in DW, and this time the wizard saw the recordset OK.

However, when I put the page up, its no longer displaying any destinations (I checked it was after redoing the recordset, so its only after I added the repeating table...

packageDetailsTest6.php?packageID=140

Attached Files
packageDetailsTest6.php.zip
Sign in to reply to this post

iainmacdonald331081

Getting there - I'd missed that the DA repeating table wizard didn't go through the fields to be included. As far as I can tell it just creates the shell, and needs to be built up manually with the fields, unless I've missed something.

I copied over the little table from my other page :

<table border="0" cellspacing="0" cellpadding="0">
<tr><td class="categorypic"><a href="destinationDetails.php?destinationID=<?php echo(rawurlencode($row_WADAdestinations['destinationID'])); ?>" title="Image Name"><img class="WADAResultThumb" border="0" src="../images/destinationpics/<?php echo $row_WADAdestinations["image_main"]; ?>" alt="Image Name" height="182px width="182px"/></a></td></tr>
<tr><td class="categorycell"><strong><?php echo $row_WADAdestinations["destination"]; ?></strong><br>
<?php echo $row_WADAdestinations["shortdesc"]; ?>
<p><a href="destinationDetails.php?destinationID=<?php echo(rawurlencode($row_WADAdestinations['destinationID'])); ?>" title="View"><img src="images/learnbutton1.jpg" alt="View" name="View" border="0" id="View" onMouseOver="MM_swapImage('View','','plugins/images/learnbutton2.jpg',1)" onMouseOut="MM_swapImgRestore()" /></a>
</td></tr>
</table>



But that only seems to have created a single column within the table :

packageDetailsTest6.php?packageID=140

Rather than the four columns here :

destinationstemp.php

Have attached a current version of packageDetailsTest6.php....

Attached Files
packageDetailsTest6.php.zip
Sign in to reply to this post

iainmacdonald331081

Think I've got it now - I think I must have copied the other little table before I redid the recordset.

Have been trying it again, and it seems OK now :

packageDetailsTest9.php?packageID=140

Sign in to reply to this post

Build websites with a little help from your friends

Your friends over here at WebAssist! These Dreamweaver extensions will assist you in building unlimited, custom websites.

Build websites from already-built web applications

These out-of-the-box solutions provide you proven, tested applications that can be up and running now.  Build a store, a gallery, or a web-based email solution.

Want your website pre-built and hosted?

Close Windowclose

Rate your experience or provide feedback on this page

Account or customer service questions?
Please user our contact form.

Need technical support?
Please visit support to ask a question

Content

rating

Layout

rating

Ease of use

rating

security code refresh image

We do not respond to comments submitted from this page directly, but we do read and analyze any feedback and will use it to help make your experience better in the future.

Close Windowclose

We were unable to retrieve the attached file

Close Windowclose

Attach and remove files

add attachmentAdd attachment
Close Windowclose

Enter the URL you would like to link to in your post

Close Windowclose

This is how you use right click RTF editing

Enable right click RTF editing option allows you to add html markup into your tutorial such as images, bulleted lists, files and more...

-- click to close --

Uploading file...