close ad
 
Important WebAssist Announcement
open ad
View Menu

Technical Support Forums

Free, outstanding support from WebAssist and your colleagues

rating

products not displaying in results page

Thread began 2/05/2014 6:11 am by Jamie | Last modified 2/11/2014 10:39 am by Jamie | 2714 views | 17 replies |

Jamie

products not displaying in results page

Hey Jason

Am just implementing mod rewrite on a site and since doing that (which works fine) the data from the database is no longer being shown on the page.

If you go here: http://www.hairmekanix.co.uk/sections.php and then click on any of the categories, for example, 'electricals' you will see the following text "Don't Panic! Products are coming to this section shortly!!" when in fact there should be 2 product items showing.

I have attached the file and would be really grateful if you could take a look please?

Many thanks

Sign in to reply to this post

Jason ByrnesWebAssist

you only updated the ProductCategories recordset to use the permalinks, you dint update the Products recordset.

Sign in to reply to this post

Jamie

Aha gotcha! Many thanks. Thats working great and was something that I needed to be able to get some breadcrumbs working on the product detail page.

On that page, however, regardless of which section the product is in, the first record of the table (shampoos) displays as the section rather than the right one and as a result the link back to the category sections is also set to 'shampoos'.

If you look at http://www.hairmekanix.co.uk/product/hairdryer , the breadcrumb should be 'Electricals' rather than shampoo.

Have attached the page.

In the ProductsCategory recordset I have toggle the $colname_ProductsCategory = between 1 and -1. With -1 it doesnt show the category at all (its just blank between >> >> ) and with 1 it shows the category albeit incorrectly.

TIA

Jamie

Sign in to reply to this post

Jason ByrnesWebAssist

again, the ProductsCategory recordset only uses the product ID filter.


since you are using the permalink address, you need to add the permalink filter to _all_ of the recordsets on the page.

Sign in to reply to this post

Jamie

sorry Jason but I have added it to the recordset:

<?php
$colname_CategoryPerm = "-1";
if (isset($_GET['perm'])) {
$colname_CategoryPerm = $_GET['perm'];
}

$colname_ProductsCategory = "-1";
if (isset($_GET['id'])) {
$colname_ProductsCategory = $_GET['id'];
}

mysql_select_db($database_PowerCMSConnection, $PowerCMSConnection);
$query_ProductsCategory = sprintf("SELECT products.*, productcategories.* FROM products INNER JOIN productcategories ON products.ProductCategoryID = productcategories.CategoryID WHERE ProductID = %s OR CatPermalink = %s", GetSQLValueString($colname_ProductsCategory, "text"),GetSQLValueString($colname_CategoryPerm, "text"));
$ProductsCategory = mysql_query($query_ProductsCategory, $PowerCMSConnection) or die(mysql_error());
$row_ProductsCategory = mysql_fetch_assoc($ProductsCategory);
$totalRows_ProductsCategory = mysql_num_rows($ProductsCategory);
?>
Sign in to reply to this post

Jason ByrnesWebAssist

try echoing the SQL to the page. add this code in the body:

<?php echo $query_ProductsCategory; ?>

then copy the SQL and run it directly on the database. Does it return the desired result?

Sign in to reply to this post

Jamie

OK, I get

SELECT products.*, productcategories.* FROM products INNER JOIN productcategories ON products.ProductCategoryID = productcategories.CategoryID WHERE ProductID = '-1' OR CatPermalink = 'brush'



have run it on 2 tables (products and productcategories) and nothing shows in the results in either of them.

Sign in to reply to this post

Jason ByrnesWebAssist

See PM.

Sign in to reply to this post

Jamie

See PM

Sign in to reply to this post

Jason ByrnesWebAssist

See PM

Sign in to reply to this post
loading

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