close ad
 
Important WebAssist Announcement
open ad
View Menu

Technical Support Forums

Free, outstanding support from WebAssist and your colleagues

rating

Problem records being returned

Thread began 6/11/2016 1:54 am by markdoyle87077 | Last modified 7/07/2016 7:22 pm by Ray Borduin | 5205 views | 14 replies |

markdoyle87077

Problem records being returned

I have set up my search page and when I search for 0070 8 foil balloons are returned. The recordset I am using for this is:

php:
<?php

$rs_foil 
= new WA_MySQLi_RS("rs_foil",$dmbc_database,0);
$rs_foil->setQuery("SELECT products.id, products.itemnumber, products.description, products.categories, products.category_type, products.status, products.type, products.productdescription, products.typename, products.selling_quantity, products.price, products.image, products.imagelarge, products.volumediscount, products.supplier, products.supplierlogo, products.stock, products.onorder, products.packed, products.customer_back_orders, products.pending_online_orders, products.visible, products.product_arrival_date, special_prices.price AS special_price FROM products LEFT OUTER JOIN special_prices ON products.itemnumber = special_prices.itemnumber AND special_prices.userdetails_id = ? WHERE visible = 1 AND category_type='Foil Balloons' AND (products.itemnumber LIKE ? OR products.supplieritemnumber LIKE ? OR description LIKE ? OR keywords LIKE ? OR supplier LIKE ?) ORDER BY description ASC");
$rs_foil->bindParam("i""".($rs_customer->getColumnVal("id"))  ."""-1"); //colname
$rs_foil->bindParam("c""".(isset($_SESSION['keywords'])?$_SESSION['keywords']:"")  ."""-1"); //colname1
$rs_foil->bindParam("c""".(isset($_SESSION['keywords'])?$_SESSION['keywords']:"")  ."""-1"); //colname2
$rs_foil->bindParam("c""".(isset($_SESSION['keywords'])?$_SESSION['keywords']:"")  ."""-1"); //colname3
$rs_foil->bindParam("c""".(isset($_SESSION['keywords'])?$_SESSION['keywords']:"")  ."""-1"); //colname4
$rs_foil->bindParam("c""".(isset($_SESSION['keywords'])?$_SESSION['keywords']:"")  ."""-1"); //colname5
$rs_foil->execute();
?>


I then have an option to sort these by size/type using the following URL:

http://www.dmballooncompany.com/php/gb/registered/products/category_search.php?category=0070&category_type=Foil Balloons

The problem is no products are returned. The recordset I am using for this is below. It is modified version of the recordset at the top of the page and I am cannot seem to work out why no products are returned. What is even more strange is that if I search for love 82 products are returned and then when I click the URL to sort by size/type 82 products are shown.

php:
<?php

$rs_products 
= new WA_MySQLi_RS("rs_products",$dmbc_database,0);
$rs_products->setQuery("SELECT products.id, products.itemnumber, products.description, products.categories, products.category_type, products.status, products.type, products.productdescription, products.typename, products.selling_quantity, products.price, products.image, products.imagelarge, products.volumediscount, products.supplier, products.supplierlogo, products.stock, products.onorder, products.packed, products.customer_back_orders, products.pending_online_orders, products.visible, products.product_arrival_date, special_prices.price AS special_price FROM products LEFT OUTER JOIN special_prices ON products.itemnumber = special_prices.itemnumber AND special_prices.userdetails_id = ? WHERE visible = 1 AND category_type=? AND (products.itemnumber LIKE ? OR products.supplieritemnumber LIKE ? OR description LIKE ? OR keywords LIKE ? OR supplier LIKE ?) ORDER BY type, description ASC");
$rs_products->bindParam("i""".($rs_customer->getColumnVal("id"))  ."""-1"); //colname
$rs_products->bindParam("s""".(isset($_GET['category_type'])?$_GET['category_type']:"")  ."""-1"); //colname1
$rs_products->bindParam("c""".(isset($_GET['category'])?$_GET['category']:"")  ."""-1"); //colname2
$rs_products->bindParam("c""".(isset($_GET['category'])?$_GET['category']:"")  ."""-1"); //colname3
$rs_products->bindParam("c""".(isset($_GET['category'])?$_GET['category']:"")  ."""-1"); //colname4
$rs_products->bindParam("c""".(isset($_GET['category'])?$_GET['category']:"")  ."""-1"); //colname5
$rs_products->bindParam("c""".(isset($_GET['category'])?$_GET['category']:"")  ."""-1"); //colname6
$rs_products->execute();
?>


Any ideas?

Sign in to reply to this post

santius355196

I don't see the issue in the recordsets themselves...

I'd start by adding some debug code and see if you can spot the problem in the SQL statement on the page that isn't working.

Add this to the page:

<?php
$rs_products->debugSQL()
?>

See if that looks right. If it does, maybe it is a problem where they are displayed and not the recordset itself. If you attach a copy of the search and category_search pages I can take a look and see if I can spot the problem that way.

Sign in to reply to this post

markdoyle87077

Thank you for taking the time to look.

Sign in to reply to this post

Ray BorduinWebAssist

Did the debug SQL look like what you expected? Maybe the cookie isn't getting set properly or that isn't the right information in the database.

I'll need to debug to know for sure and to do that I'd need login information to get the cookie set and FTP access to add my own debug code.

Sign in to reply to this post
Did this help? Tips are appreciated...

markdoyle87077

See pm

Sign in to reply to this post

Ray BorduinWebAssist

I can't seem to connect with that FTP information. Please verify it works for you and doesn't have any typos. Also make sure there aren't any additional settings I need to use in order to connect.

Sign in to reply to this post
Did this help? Tips are appreciated...

markdoyle87077

Hi Ray, I have incoming FTP sessions set to use only my IP. Do you have a static IP I can add to the firewall?

Sign in to reply to this post

Ray BorduinWebAssist

see private area for my IP

Sign in to reply to this post
Did this help? Tips are appreciated...

markdoyle87077

Hi Ray, Thought I had replied earlier but obviously not. I have added your IP to the firewall so you should be able to connect now.

Sign in to reply to this post

Ray BorduinWebAssist

I still can't seem to connect with that FTP information. What was the result when you added this debug code to the page:


<?php
$rs_products->debugSQL()
?>

Sign in to reply to this post
Did this help? Tips are appreciated...
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...