close ad
Install the LAtest Updates to Work with CC 2017 and CC 2018
open ad
View Menu

Technical Support Forums

Free, outstanding support from WebAssist and your colleagues

Help with inner join query

Thread began 8/12/2010 4:34 am by iainmacdonald331081 | Last modified 8/13/2010 3:40 am by iainmacdonald331081 | 2856 views | 16 replies

iainmacdonald331081

OK - now I'm going to need your help in getting the destinations on this page to appear in a grid layout as they do on the original page created by DA.

I'm going to assume it'll be reasonably straightforward for you to guide me through it...

Basically, this is the original page created by DA that lists the destinations on their own :

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).

So I'd like the destinations to appear in that same grid layout on the package details page here :

packageDetailsTest4.php?packageID=140

I assume its just a case of reusing some code from the destinationstemp.php page - I could have a stab at it manually, but I'd likely mess it all up....

Presumably this is the code that sets it all up in the destinationstemp.php page :

<?php
$maxRows_WADAdestinations = 20;
$pageNum_WADAdestinations = 0;
if (isset($_GET['pageNum_WADAdestinations'])) {
$pageNum_WADAdestinations = $_GET['pageNum_WADAdestinations'];
}
$startRow_WADAdestinations = $pageNum_WADAdestinations * $maxRows_WADAdestinations;

mysql_select_db($database_connPackages, $connPackages);
$query_WADAdestinations = "SELECT destinationID, destination, description, shortdesc, image_main, image_2, image_3 FROM destinations ORDER BY destination ASC";
setQueryBuilderSource($query_WADAdestinations,$WADbSearch1,false);
$query_limit_WADAdestinations = sprintf("%s LIMIT %d, %d", $query_WADAdestinations, $startRow_WADAdestinations, $maxRows_WADAdestinations);
$WADAdestinations = mysql_query($query_limit_WADAdestinations, $connPackages) or die(mysql_error());
$row_WADAdestinations = mysql_fetch_assoc($WADAdestinations);

if (isset($_GET['totalRows_WADAdestinations'])) {
$totalRows_WADAdestinations = $_GET['totalRows_WADAdestinations'];
} else {
$all_WADAdestinations = mysql_query($query_WADAdestinations);
$totalRows_WADAdestinations = mysql_num_rows($all_WADAdestinations);
}
$totalPages_WADAdestinations = ceil($totalRows_WADAdestinations/$maxRows_WADAdestinations)-1;
?>
<?php
$queryString_WADAdestinations = "";
if (!empty($_SERVER['QUERY_STRING'])) {
$params = explode("&", $_SERVER['QUERY_STRING']);
$newParams = array();
foreach ($params as $param) {
if (stristr($param, "pageNum_WADAdestinations") == false &&
stristr($param, "totalRows_WADAdestinations") == false) {
array_push($newParams, $param);
}
}
if (count($newParams) != 0) {
$queryString_WADAdestinations = "&" . htmlentities(implode("&", $newParams));
}
}
$queryString_WADAdestinations = sprintf("&totalRows_WADAdestinations=%d%s", $totalRows_WADAdestinations, $queryString_WADAdestinations);
?>



But I'm not sure how to go about reusing it with the new query in the packageDetailsTest4.php page without messing it up.

I have at least changed the recordset name to WADAdestinations which should help.

I've attached a zip of both pages - if you could advise which code to use in the new page to achieve the grid layout I'd be very grateful.

Attached Files
Archive.zip

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...