I have a bit of code that I'm trying to upgrade to 1.3.8/9. I'm trying to put in a drop down box populated from a table - a simple list of months and month id.
When I add in the db execute statement, the page stops but no error message is generated in the cache. I want to see the query but don't recall how to print the query to the screen.
I suspect there's other things wrong with this code but this was the first thing I wanted to check.
By the way this code is going in the template file - tpl_index_product_list.php and am fully aware this is not how it's usually done - having all of the is code there. However, just trying to get this to work where the original changed code was before.
The cart is 1.3.9g.
Here is the code:
if(isset($_GET['filter_month_id']))
{
$selected_month=$_GET['filter_month_id'];
}
$months_query = $db->Execute("select * from month");
$monthList = $db->Execute($months_query);
if ($monthList->RecordCount()>0) {
$number_of_rows = $monthList->RecordCount()+1;
$monthList_array = array();
}
while (!$monthList->EOF) {
$month_name = $monthList->fields['month_name'];
$monthList_array[] = array('id' => $monthList->fields['month_id'],
'text' => $month_name);
$monthList->MoveNext();
}
zen_draw_pull_down_menu('filter_month_id', $monthList_array, (isset($_GET['filter_month_id']) ? $_GET['filter_month_id'] : ''), 'onchange="this.form.submit();"') . zen_hide_session_id();


Reply With Quote

