chrometweaks.org

Which are the best, affordable iPage web hosts when starting a online shop?

Click Here To View All Answers...


Quick question: Which are the best, affordable iPage web hosts when starting a online shop? Looking forward for any answer or 2. Another question I got... JanZ.

I did try to add those querys but they came up with errors,.

Your suggestions are appreciated..

Comments (90)

Good question... I dunno what is the answer. I'll do some research in Google and get back to you if I find an good answer. You should email the people at iPage as they probably can help you..

Comment #1

JanZ,.

Essentially I'm trying to duplicate the manufacturers table but not the dropdown in the product listing.

There is a drop down in use for the manufacturer (now renamed & used for locations) which I changed for use to search by location.

In the listing I want the employers to display, manufacturer to display & search the by manufacturer drop down.

I don't need a drop down for the employer in the product listing.

Thank you again for your time..

Comment #2

This image might help to explain alittle better.

When I use the click on the category, or search by the manufacturers drop down, this is when the product multiplies 9x for the employer type, for the same product..

Comment #3

Did you find that:.

TABLE_EMPLOYERS" e where p.employers_id=e.employers_id,.

Didn't work either?..

Comment #4

JanZ,.

Yes, I did try that but got an error.

1064 - You have an error in your SQL syntax near 'on p.employers_id = e.employers_id, products_to_categories p2c left join specia' at line 1.

Select count(*) as total from products_description pd, products p left join manufacturers m on p.manufacturers_id = m.manufacturers_id, employers e on p.employers_id = e.employers_id, products_to_categories p2c left join specials s on p.products_id = s.products_id where p.products_status = '1' and p.products_id = p2c.products_id and pd.products_id = p2c.products_id and pd.language_id = '1' and p2c.categories_id = '62'.

[TEP STOP]..

Comment #5

There are subtle difference in using "on" or "where"..

Employers e on p.employers_id = e.employers_id.

Please try, "where" and cross your fingers ;-)..

Comment #6

I did cross my fingers & got this.

1064 - You have an error in your SQL syntax near 'products_to_categories p2c left join specials s on p.products_id = s.products_id' at line 1.

Select count(*) as total from products_description pd, products p left join manufacturers m on p.manufacturers_id = m.manufacturers_id, employers e where p.employers_id = e.employers_id products_to_categories p2c left join specials s on p.products_id = s.products_id where p.products_status = '1' and p.products_id = p2c.products_id and pd.products_id = p2c.products_id and pd.language_id = '1' and p2c.categories_id = '62'.

[TEP STOP]..

Comment #7

What does it say when you add a comma:.

Employers e on p.employers_id = e.employers_id,..

Comment #8

Well spotted, about the missing comma, but still the same error.

 .

 .

1064 - You have an error in your SQL syntax near ' products_to_categories p2c left join specials s on p.products_id = s.products_i' at line 1.

Select count(*) as total from products_description pd, products p left join manufacturers m on p.manufacturers_id = m.manufacturers_id, employers e where p.employers_id = e.employers_id, products_to_categories p2c left join specials s on p.products_id = s.products_id where p.products_status = '1' and p.products_id = p2c.products_id and pd.products_id = p2c.products_id and pd.language_id = '1' and p2c.categories_id = '62'.

[TEP STOP]..

Comment #9

Did you try:.

M.manufacturers_id left join employers e on p.employers_id = e.employers_id,.

Yet?..

Comment #10

JanZ yes I did try it.

 .

1064 - You have an error in your SQL syntax near 'where p.employers_id = e.employers_id, products_to_categories p2c left join spec' at line 1.

Select count(*) as total from products_description pd, products p left join manufacturers m on p.manufacturers_id = m.manufacturers_id left join employers e where p.employers_id = e.employers_id, products_to_categories p2c left join specials s on p.products_id = s.products_id where p.products_status = '1' and p.products_id = p2c.products_id and pd.products_id = p2c.products_id and pd.language_id = '1' and p2c.categories_id = '62'  ..

Comment #11

Great.

I changed it the "where" to "on" & it worked !!! Fantastic.

$listing_sql = "select "$select_column_list" p.products_id, p.manufacturers_id, p.employers_id, p.products_price, p.products_tax_class_id, IF(s.status, s.specials_new_products_price, NULL) as specials_new_products_price, IF(s.status, s.specials_new_products_price, p.products_price) as final_price from "TABLE_PRODUCTS_DESCRIPTION" pd, "TABLE_PRODUCTS" p left join "TABLE_MANUFACTURERS" m on p.manufacturers_id = m.manufacturers_id left join "TABLE_EMPLOYERS" e on p.employers_id = e.employers_id, "TABLE_PRODUCTS_TO_CATEGORIES" p2c left join "TABLE_SPECIALS" s on p.products_id = s.products_id where p.products_status = '1' and p.products_id = p2c.products_id and pd.products_id = p2c.products_id and pd.language_id = '"$languages_id"' and p2c.categories_id = '"$current_category_id"'";.

     }.

Janz, A REALLY BIG THANKYOU!!!! Your help is appreciated..

Comment #12

Finally got around to the advanced search result but I'm having issues with this query.

$from_str = "from "TABLE_PRODUCTS" p left join "TABLE_MANUFACTURERS" m using(manufacturers_id) left join "TABLE_EMPLOYERS" e using(employers_id), "TABLE_PRODUCTS_DESCRIPTION" pd left join "TABLE_SPECIALS" s on p.products_id = s.products_id, "TABLE_CATEGORIES" c, "TABLE_PRODUCTS_TO_CATEGORIES" p2c";.

Error.

1054 - Unknown column 'm.employers_id' in 'on clause'.

Select count(*) as total from products p left join manufacturers m using(manufacturers_id) left join employers e using (employers_id), products_description pd left join specials s on p.products_id = s.products_id, categories c, products_to_categories p2c where p.products_status = '1' and p.products_id = pd.products_id and pd.language_id = '1' and p.products_id = p2c.products_id and p2c.categories_id = c.categories_id.

[TEP STOP].

I've tried all the different combinations of e left join.

E on p.employers_id = e.employers_id left join.

E using (employers_id) left join.

Etc .....

I know that there are other people are looking for the same thing, so I would be happy to realease this as a contribtuion with a Big thank you to JanZ.

For all of his time & efforts.

This post has been edited by.

Davee.

: 01 September 2004, 23:20..

Comment #13

Please, can anyone help with this query?.

$from_str = "from "TABLE_PRODUCTS" p left join "TABLE_MANUFACTURERS" m using(manufacturers_id) left join "TABLE_EMPLOYERS" e using(employers_id), "TABLE_PRODUCTS_DESCRIPTION" pd left join "TABLE_SPECIALS" s on p.products_id = s.products_id, "TABLE_CATEGORIES" c, "TABLE_PRODUCTS_TO_CATEGORIES" p2c";.

Error.

1054 - Unknown column 'm.employers_id' in 'on clause'.

Select count(*) as total from products p left join manufacturers m using(manufacturers_id) left join employers e using (employers_id), products_description pd left join specials s on p.products_id = s.products_id, categories c, products_to_categories p2c where p.products_status = '1' and p.products_id = pd.products_id and pd.language_id = '1' and p.products_id = p2c.products_id and p2c.categories_id = c.categories_id.

[TEP STOP]..

Comment #14

The problem is that the three tables do not have a common key: products has a key in common with manufacturers and products has an another key in common with employers. So far, I haven't found an example on the web for doing this particular query, but if you make products the middle table by using a right joint on manufacturers, it might work..

Change:.

$from_str = "from "TABLE_PRODUCTS" p left join "TABLE_MANUFACTURERS" m using(manufacturers_id) left join "TABLE_EMPLOYERS" e using(employers_id),.

To:.

$from_str = "from "TABLE_MANUFACTURERS" m right join "TABLE_PRODUCTS" p using(manufacturers_id) left join "TABLE_EMPLOYERS" e using(employers_id),..

Comment #15

JanZ.

After looking at the code I finally managed to get the employer to show with this query (in advanced search result).

$from_str = "from "TABLE_PRODUCTS" p left join "TABLE_MANUFACTURERS" m using(manufacturers_id), "TABLE_PRODUCTS_DESCRIPTION" pd left join "TABLE_EMPLOYERS" e on p.employers_id = e.employers_id, "TABLE_CATEGORIES" c, "TABLE_PRODUCTS_TO_CATEGORIES" p2c";.

Now I cant get the description to show any longer, but the salary repeats in the advanced search result.

I have this working on the index perfectly..

Comment #16

Did you add "AND p.employer_id = e.employer_id" to the WHERE clause a couple of lines further down?.

I don't think it explains the missing description and the double salary, but there are also no lines in between the different vacancies and that looks fishy.....

Comment #17

Sorry JanZ, I'm not too sure where you mean in the WHERE clause.

<?php.

/*.

 $Id: advanced_search_result.php,v 1.67 2003/02/13 04:23:22 hpdl Exp $.

 osCommerce, Open Source E-Commerce Solutions.

 http://www.oscommerce.com.

 Copyright (c) 2003 osCommerce.

 Released under the GNU General Public License.

*/.

 require('includes/application_top.php');.

 require(DIR_WS_LANGUAGES$language'/'FILENAME_ADVANCED_SEARCH_RESULT);.

 $error = 0; // reset error flag to false.

 $errorno = 0;.

 if ( (isset($HTTP_GET_VARS['keywords']) && empty($HTTP_GET_VARS['keywords'])) &&.

      (isset($HTTP_GET_VARS['dfrom']) && (empty($HTTP_GET_VARS['dfrom']) || ($HTTP_GET_VARS['dfrom'] == DOB_FORMAT_STRING))) &&.

      (isset($HTTP_GET_VARS['dto']) && (empty($HTTP_GET_VARS['dto']) || ($HTTP_GET_VARS['dto'] == DOB_FORMAT_STRING))) &&.

      (isset($HTTP_GET_VARS['pfrom']) && empty($HTTP_GET_VARS['pfrom'])) &&.

      (isset($HTTP_GET_VARS['pto']) && empty($HTTP_GET_VARS['pto'])) ) {.

   $errorno += 1;.

   $error = 1;.

 }.

 $dfrom_to_check = (($HTTP_GET_VARS['dfrom'] == DOB_FORMAT_STRING) ? '' : $HTTP_GET_VARS['dfrom']);.

 $dto_to_check = (($HTTP_GET_VARS['dto'] == DOB_FORMAT_STRING) ? '' : $HTTP_GET_VARS['dto']);.

 if (strlen($dfrom_to_check) > 0) {.

   if (!tep_checkdate($dfrom_to_check, DOB_FORMAT_STRING, $dfrom_array)) {.

     $errorno += 10;.

     $error = 1;.

   }.

 }  .

 if (strlen($dto_to_check) > 0) {.

   if (!tep_checkdate($dto_to_check, DOB_FORMAT_STRING, $dto_array)) {.

     $errorno += 100;.

     $error = 1;.

   }.

 }  .

 if (strlen($dfrom_to_check) > 0 && !(($errorno & 10) == 10) && strlen($dto_to_check) > 0 && !(($errorno & 100) == 100)) {.

   if (mktime(0, 0, 0, $dfrom_array[1], $dfrom_array[2], $dfrom_array[0]) > mktime(0, 0, 0, $dto_array[1], $dto_array[2], $dto_array[0])) {.

     $errorno += 1000;.

     $error = 1;.

   }.

 }.

 if (strlen($HTTP_GET_VARS['pfrom']) > 0) {.

   $pfrom_to_check = $HTTP_GET_VARS['pfrom'];.

   if (!settype($pfrom_to_check, "double")) {.

     $errorno += 10000;.

     $error = 1;.

   }.

 }.

 if (strlen($HTTP_GET_VARS['pto']) > 0) {.

   $pto_to_check = $HTTP_GET_VARS['pto'];.

   if (!settype($pto_to_check, "double")) {.

     $errorno += 100000;.

     $error = 1;.

   }.

 }.

 if (strlen($HTTP_GET_VARS['pfrom']) > 0 && !(($errorno & 10000) == 10000) && strlen($HTTP_GET_VARS['pto']) > 0 && !(($errorno & 100000) == 100000)) {.

   if ($pfrom_to_check > $pto_to_check) {.

     $errorno += 1000000;.

     $error = 1;.

   }.

 }.

 if (strlen($HTTP_GET_VARS['keywords']) > 0) {.

   if (!tep_parse_search_string(stripslashes($HTTP_GET_VARS['keywords']), $search_keywords)) {.

     $errorno += 10000000;.

     $error = 1;.

   }.

 }.

 .

 if ($error == 1) {.

   tep_redirect(tep_href_link(FILENAME_ADVANCED_SEARCH, 'errorno='$errorno'&'tep_get_all_get_params(array('x', 'y'))));.

 } else {.

   $breadcrumb->add(NAVBAR_TITLE1, tep_href_link(FILENAME_ADVANCED_SEARCH));.

   $breadcrumb->add(NAVBAR_TITLE2, tep_href_link(FILENAME_ADVANCED_SEARCH_RESULT, 'keywords='$HTTP_GET_VARS['keywords']'&search_in_description='$HTTP_GET_VARS['search_in_description']'&categories_id='$HTTP_GET_VARS['categories_id']'&inc_subcat='$HTTP_GET_VARS['inc_subcat']'&manufacturers_id='$HTTP_GET_VARS['manufacturers_id']'&pfrom='$HTTP_GET_VARS['pfrom']'&pto='$HTTP_GET_VARS['pto']'&dfrom='$HTTP_GET_VARS['dfrom']'&dto='$HTTP_GET_VARS['dto']));.

?>.

<!doctype html public "-//W3C//DTD HTML 4.01 Transitional//EN">.

<html <?php echo HTML_PARAMS; ?>>.

<head>.

<meta http-equiv="Content-Type" content="text/html; charset=<?php echo CHARSET; ?>">.

<base href="<?php echo (($request_type == 'SSL') ? HTTPS_SERVER : HTTP_SERVER)DIR_WS_CATALOG; ?>">.

<title><?php echo TITLE; ?></title>.

<link rel="stylesheet" type="text/css" href="stylesheet.css">.

</head>.

<body marginwidth="0" marginheight="0" topmargin="0" bottommargin="0" leftmargin="0" rightmargin="0">.

<! header //>.

<?php require(DIR_WS_INCLUDES'header.php'); ?>.

<! header_eof //>.

<! body //>.

<table border="0" width="100%" cellspacing="-2" cellpadding="4">.

 <tr>.

   <td class="left" width="<?php echo BOX_WIDTH; ?>" valign="top"><table border="0" width="<?php echo BOX_WIDTH; ?>" cellspacing="0" cellpadding="2">.

<! left_navigation //>.

<?php require(DIR_WS_INCLUDES'column_left.php'); ?>.

<! left_navigation_eof //>.

   </table></td>.

<! body_text //>.

   <td width="100%" valign="top"><table border="0" align="center" width="75%" cellspacing="0" cellpadding="0">.

     <tr>.

       <td><table border="0" align="left width="75%" cellspacing="0" cellpadding="0">.

         <tr>.

           <td><br><font size="5" face="Arial" align=left"><b><?php echo HEADING_TITLE; ?></b></td>.

           <td class="pageHeading" align="left"></td>.

         </tr>.

       </table></td>.

     </tr>.

     <tr>.

       <td><tr><?php //echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>.

     </tr>.

     <tr>.

       <td><hr noshade color="#000000" size="1" width="95%" align="left">.

<?php.

 // create column list.

 $define_list = array('PRODUCT_LIST_NAME' => PRODUCT_LIST_NAME,.

           'PRODUCT_LIST_DESCRIPTION' => PRODUCT_LIST_DESCRIPTION,.

            'PRODUCT_LIST_MANUFACTURER' => PRODUCT_LIST_MANUFACTURER,.

            'PRODUCT_LIST_EMPLOYER' => PRODUCT_LIST_EMPLOYER,.

           'PRODUCT_LIST_SALARY' => PRODUCT_LIST_SALARY);.

           .

 asort($define_list);.

 $column_list = array();.

 reset($define_list);.

 while (list($column, $value) = each($define_list)) {.

   if ($value) $column_list[] = $column;.

 }.

 $select_column_list = '';.

For ($col=0, $n=sizeof($column_list); $col<$n; $col++) {.

   if ( ($column_list[$col] == 'PRODUCT_LIST_BUY_NOW') || ($column_list[$col] == 'PRODUCT_LIST_NAME') || ($column_list[$col] == 'PRODUCT_LIST_PRICE') ) {.

    continue;.

   }.

   if (tep_not_null($select_column_list)) {.

     $select_column_list .= ', ';.

   }.

   switch ($column_list[$col]) {.

 .

       case 'PRODUCT_LIST_DESCRIPTION':  .

    $select_column_list .= 'pd.products_description';.

      break; .

   case 'PRODUCT_LIST_MANUFACTURER':.

       $select_column_list .= 'm.manufacturers_name';.

       break;.

   case 'PRODUCT_LIST_EMPLOYER':.

       $select_column_list .= 'e.employers_name';.

       break;.

   case 'PRODUCT_LIST_SALARY':.

       $select_column_list .= 'p.products_salary';.

       break;.

     .

   }.

 }.

 if (tep_not_null($select_column_list)) {.

   $select_column_list .= ', ';.

 }.

 $select_str = "select distinct "$select_column_list"m.manufacturers_id, e.employers_id, p.products_id, pd.products_name, p.products_salary ";.

 .

$from_str = "from "TABLE_PRODUCTS" p left join "TABLE_MANUFACTURERS" m using(manufacturers_id), "TABLE_PRODUCTS_DESCRIPTION" pd left join "TABLE_EMPLOYERS" e on p.employers_id = e.employers_id, "TABLE_CATEGORIES" c, "TABLE_PRODUCTS_TO_CATEGORIES" p2c";.

 //$from_str = "from "TABLE_PRODUCTS_DESCRIPTION" pd, "TABLE_PRODUCTS" p left join "TABLE_MANUFACTURERS" m on p.manufacturers_id = m.manufacturers_id left join "TABLE_EMPLOYERS" e on p.employers_id = e.employers_id, "TABLE_CATEGORIES" c, "TABLE_PRODUCTS_TO_CATEGORIES" p2c";.

 .

         .

 $where_str = " where p.products_status = '1' and p.products_id = pd.products_id and pd.language_id = '"$languages_id"' and p.products_id = p2c.products_id and p2c.categories_id = c.categories_id ";.

 if (isset($HTTP_GET_VARS['categories_id']) && tep_not_null($HTTP_GET_VARS['categories_id'])) {.

   if ($HTTP_GET_VARS['inc_subcat'] == '1') {.

     $subcategories_array = array();.

     tep_get_subcategories($subcategories_array, $HTTP_GET_VARS['categories_id']);.

     $where_str .= " and p2c.products_id = p.products_id and p2c.products_id = pd.products_id and (p2c.categories_id = '"(int)$HTTP_GET_VARS['categories_id']"'";.

     for ($i=0, $n=sizeof($subcategories_array); $i<$n; $i++ ) {.

       $where_str .= " or p2c.categories_id = '"$subcategories_array[$i]"'";.

     }.

     $where_str .= ")";.

   } else {.

     $where_str .= " and p2c.products_id = p.products_id and p2c.products_id = pd.products_id and pd.language_id = '"$languages_id"' and p2c.categories_id = '"$HTTP_GET_VARS['categories_id']"'";.

   }.

 }.

 if (isset($HTTP_GET_VARS['manufacturers_id']) && tep_not_null($HTTP_GET_VARS['manufacturers_id'])) {.

   $where_str .= " and m.manufacturers_id = '"$HTTP_GET_VARS['manufacturers_id']"'";.

 }.

If (isset($HTTP_GET_VARS['employers_id']) && tep_not_null($HTTP_GET_VARS['employers_id'])) {.

   $where_str .= " and e.employers_id = '"$HTTP_GET_VARS['employers_id']"'";.

 }.

 .

 if (isset($HTTP_GET_VARS['keywords']) && tep_not_null($HTTP_GET_VARS['keywords'])) {.

   if (tep_parse_search_string(stripslashes($HTTP_GET_VARS['keywords']), $search_keywords)) {.

     $where_str .= " and (";.

     for ($i=0, $n=sizeof($search_keywords); $i<$n; $i++ ) {.

       switch ($search_keywords[$i]) {.

         case '(':.

         case ')':.

         case 'and':.

         case 'or':.

           $where_str .= " "$search_keywords[$i]" ";.

           break;.

         default:.

           $where_str .= "(pd.products_name like '%"addslashes($search_keywords[$i])"%' or m.manufacturers_name like '%"addslashes($search_keywords[$i])"%' or e.employers_name like '%"addslashes($search_keywords[$i])"%'";.

           if (isset($HTTP_GET_VARS['search_in_description']) && ($HTTP_GET_VARS['search_in_description'] == '1')) $where_str .= " or pd.products_description like '%"addslashes($search_keywords[$i])"%'";.

             $where_str .= ')';.

           break;.

       }.

     }.

     $where_str .= " )";.

   }.

 }.

 if (isset($HTTP_GET_VARS['dfrom']) && tep_not_null($HTTP_GET_VARS['dfrom']) && ($HTTP_GET_VARS['dfrom'] != DOB_FORMAT_STRING)) {.

   $where_str .= " and p.products_date_added >= '"tep_date_raw($dfrom_to_check)"'";.

 }.

 if (isset($HTTP_GET_VARS['dto']) && tep_not_null($HTTP_GET_VARS['dto']) && ($HTTP_GET_VARS['dto'] != DOB_FORMAT_STRING)) {.

   $where_str .= " and p.products_date_added <= '"tep_date_raw($dto_to_check)"'";.

 }.

 $rate = $currencies->get_value($currency);.

 if ($rate) {.

   $pfrom = $HTTP_GET_VARS['pfrom'] / $rate;.

   $pto = $HTTP_GET_VARS['pto'] / $rate;.

 }.

 .

 if ( (!isset($HTTP_GET_VARS['sort'])) || (!ereg('[1-8][ad]', $HTTP_GET_VARS['sort'])) || (substr($HTTP_GET_VARS['sort'], 0 , 1) > sizeof($column_list)) ) {.

   for ($col=0, $n=sizeof($column_list); $col<$n; $col++) {.

     if ($column_list[$col] == 'PRODUCT_LIST_NAME') {.

       $HTTP_GET_VARS['sort'] = $col+1'a';.

       $order_str = ' order by pd.products_name';.

       break;.

     }.

   }.

 } else {.

   $sort_col = substr($HTTP_GET_VARS['sort'], 0 , 1);.

   $sort_order = substr($HTTP_GET_VARS['sort'], 1);.

   $order_str = ' order by ';.

   switch ($column_list[$sort_col-1]) {.

     .

   .

     case 'PRODUCT_LIST_NAME':.

       $order_str .= "pd.products_name "($sort_order == 'd' ? "desc" : "");.

       break;.

     .

     case 'PRODUCT_LIST_MANUFACTURER':.

       $order_str .= "m.manufacturers_name "($sort_order == 'd' ? "desc" : "")", pd.products_name";.

       break;.

   case 'PRODUCT_LIST_DESCRIPTION':.

   $order_str .= "pd.products_description ". ($sort_order == 'd' ? "desc" : "");.

     break;.

   case 'PRODUCT_LIST_EMPLOYER':.

    $order_str .= "e.employers_name "($sort_order == 'd' ? "desc" : "")", pd.products_name";.

      break;.

   .

     case 'PRODUCT_LIST_SALARY':.

       $order_str .= "p.products_salary "($sort_order == 'd' ? "desc" : "")", pd.products_name";.

       break;.

 .

   }.

 }.

 $listing_sql = $select_str$from_str$where_str$order_str;.

 require(DIR_WS_MODULESFILENAME_PRODUCT_LISTING);.

?>.

       </td>.

     </tr>.

     <tr>.

       <td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>.

     </tr>.

     <tr>.

       <td class="main"><?php echo '<a href="'tep_href_link(FILENAME_ADVANCED_SEARCH, tep_get_all_get_params(array('sort', 'page', 'x', 'y')), 'NONSSL', true, false)'">'tep_image_button('button_back.gif', IMAGE_BUTTON_BACK)'</a>'; ?></td>.

     </tr>.

   </table></td>.

<! body_text_eof //>.

   .

<! right_navigation //>.

<?php //require(DIR_WS_INCLUDES'column_right.php'); ?>.

<! right_navigation_eof //>.

 .

<! body_eof //>.

<! footer //>.

<?php require(DIR_WS_INCLUDES'footer.php'); ?>.

<! footer_eof //>.

<br>.

</body>.

</html>.

<?php.

 }.

 require(DIR_WS_INCLUDES'application_bottom.php');.

?>..

Comment #18

I'm talking nonsense, most likely that is already covered in.

TABLE_EMPLOYERS" e on p.employers_id = e.employers_id,.

However the double salary listing might (might!) be explained by the fact that it is already in the $select_column_list (not sure if it always gets included, but you might check that by "echo $listing_sql" after it is constructed and test several different ways). A few lines further down it is mentioned again in $select_str..

Case 'PRODUCT_LIST_SALARY':.

$select_column_list .= 'p.products_salary';.

Break;.

}.

}.

If (tep_not_null($select_column_list)) {.

$select_column_list .= ', ';.

}.

$select_str = "select distinct "$select_column_list"m.manufacturers_id, e.employers_id, p.products_id, pd.products_name, p.products_salary ";..

Comment #19

As an aside... since // is only for commenting single lines it might be wiser to use /* at the beginning and */ at the end of the part you want to make commented:.

To:.

I don't know if it gives any trouble now, but better safe than sorry...

Comment #20

JanZ,.

I really do appreciated you help & advise,.

The query is a single line so it is commented out, it is another query that I was testing (The query shows as it uses more than one line due to the width of the code box).

I have tried a few things as you suggested.

Removed the salary from the query below didn't make any difference.

$select_str = "select distinct "$select_column_list"m.manufacturers_id, e.employers_id, p.products_id, pd.products_name ";.

When I commented our the Salary from the define list string the employer doubled.

// create column list.

 $define_list = array('PRODUCT_LIST_NAME' => PRODUCT_LIST_NAME,.

            'PRODUCT_LIST_MANUFACTURER' => PRODUCT_LIST_MANUFACTURER,.

           'PRODUCT_LIST_EMPLOYER' => PRODUCT_LIST_EMPLOYER,.

             //'PRODUCT_LIST_SALARY' => PRODUCT_LIST_SALARY,.

           'PRODUCT_LIST_DESCRIPTION' => PRODUCT_LIST_DESCRIPTION);.

I begining to think that it is this query that wrong but I can't for the life of me work out why.

$from_str = "from "TABLE_PRODUCTS" p left join "TABLE_MANUFACTURERS" m using(manufacturers_id), "TABLE_PRODUCTS_DESCRIPTION" pd left join "TABLE_EMPLOYERS" e on p.employers_id = e.employers_id, "TABLE_CATEGORIES" c, "TABLE_PRODUCTS_TO_CATEGORIES" p2c";.

I have tried different variations of the query & even tried the one from the index which is almost identical but I totally lost to why is won't work on the advanced search result.

Thanks again.

Dave..

Comment #21

Seems bizar but surely there is a logical explanation....

$from_str = "from "TABLE_PRODUCTS" p left join "TABLE_MANUFACTURERS" m using(manufacturers_id), "TABLE_PRODUCTS_DESCRIPTION" pd left join "TABLE_EMPLOYERS" e on p.employers_id = e.employers_id, "TABLE_CATEGORIES" c, "TABLE_PRODUCTS_TO_CATEGORIES" p2c";.

The original query started with TABLE_PRODUCTS_DESCRIPTION. Somewhere in the joins it looks you get a doubling of rows. Since the one on the index page, where you grouped TABLE_PRODUCTS, TABLE_MANUFACTURERS and TABLE_EMPLOYERS together, I would try to keep that. The 'right join', 'left join' I suggested didn't work I suppose?.

I would definitely try to echo a $listing_sql and copy paste that in phpAdmin or the mysql terminal window to see the total output of that query. There you might see where the doubling of rows occurs. It may give a better insight what goes wrong and why...

Comment #22

JanZ,.

I've just been playing with the query in phpmyadmin.

SELECT 'manufacturers_id', 'employers_id', 'products_id', 'products_name', 'products_salary'.

FROM products.

LEFT JOIN manufacturers.

USING ( manufacturers_id ) , products_description.

LEFT JOIN employers ON products 'employers_id' = employers 'employers_id', categories, products_to_categories.

WHERE 'products_status' = '1'.

LIMIT 0 , 30.

MySQL said:.

You have an error in your SQL syntax near ''employers_id' = employers 'employers_id', categories, products_to_categories.

WH' at line 5.

Here is part of the query.

SELECT 'manufacturers_id', 'employers_id', 'products_id', 'products_name', 'products_salary' FROM products LEFT JOIN manufacturers using(manufacturers_id), products_description LEFT JOIN employers ON products 'employers_id'= employers 'employers_id', categories, products_to_categories WHERE 'products_status' ='1'.

This post has been edited by.

Davee.

: 07 September 2004, 00:34..

Comment #23

SELECT 'manufacturers_id', 'employers_id', 'products_id', 'products_name', 'products_salary'.

FROM products.

LEFT JOIN manufacturers.

USING ( manufacturers_id ) , products_description.

LEFT JOIN employers ON products 'employers_id' = employers 'employers_id',.

Actually, you should tell mysql from which table employers_id should come from (by putting the table name in front of it: products.employers_id). Since more than one table have employers_id in it, employers_id is ambiguous..

ON products 'employers_id' = employers 'employers_id'.

Should therefore be: products.employers_id = employers.employers_id.

I wouldn't put single quotes around the field names, by the way..

Note: sorry, I'm gone for a week.....

Comment #24

JanZ, hope you had a good time away.....

I finally got it finished, Thank you again for your support.

Just having a play with the sort by employers feature.

I think this is the code where I need to be looking, but not sure where to start from the index.php .......

// show the products of a specified manufacturer.

   if (isset($HTTP_GET_VARS['manufacturers_id'])) {.

     if (isset($HTTP_GET_VARS['filter_id'])) {.

// We are asked to show only a specific category.

       .

       $listing_sql = "select "$select_column_list" p.products_id, p.manufacturers_id, p.products_price, p.products_tax_class_id, IF(s.status, s.specials_new_products_price, NULL) as specials_new_products_price, IF(s.status, s.specials_new_products_price, p.products_price) as final_price from "TABLE_PRODUCTS" p, "TABLE_PRODUCTS_DESCRIPTION" pd, "TABLE_MANUFACTURERS" m, "TABLE_PRODUCTS_TO_CATEGORIES" p2c left join "TABLE_SPECIALS" s on p.products_id = s.products_id where p.products_status = '1' and p.manufacturers_id = m.manufacturers_id and m.manufacturers_id = '"$HTTP_GET_VARS['manufacturers_id']"' p.employers_id = e.employers_id and e.employers_id = '"$HTTP_GET_VARS['employers_id']"' and p.products_id = p2c.products_id and pd.products_id = p2c.products_id and pd.language_id = '"$languages_id"' and p2c.categories_id = '"$HTTP_GET_VARS['filter_id']"'";.

 } else {.

// We show them all.

       $listing_sql = "select "$select_column_list" p.products_id, p.manufacturers_id, p.employers_id, p.products_price, p.products_tax_class_id, IF(s.status, s.specials_new_products_price, NULL) as specials_new_products_price, IF(s.status, s.specials_new_products_price, p.products_price) as final_price from "TABLE_PRODUCTS" p, "TABLE_PRODUCTS_DESCRIPTION" pd, "TABLE_MANUFACTURERS" m left join "TABLE_EMPLOYERS" e on p.employers_id = e.employers_id left join "TABLE_SPECIALS" s on p.products_id = s.products_id where p.products_status = '1' and pd.products_id = p.products_id and pd.language_id = '"$languages_id"' and p.manufacturers_id = m.manufacturers_id and m.manufacturers_id = '"$HTTP_GET_VARS['manufacturers_id']"'";.

     }.

Ive try to copy the code copying & remaming the query for employers.

When I click on the link the URL comes back correctly "index.php/employers_id=1" but doesn't show the result, simply returns to the index page.

I also have copied the drop down & this also returns the correct URL, so it seams like it's not returning the query.

PS I have copied the same query in the general file for employers etc.....

Comment #25

Hi.

I have redesigned OS for use as an employment agency web site.

I have duplicated the manufacturers table so that we can use a drop down for employer types which works great.

The only problem i'm having is trying to show the employer type in product listing.

I have copied the.

Case 'PRODUCT_LIST_MANUFACTURER':.

         $listing_sql .= "m.manufacturers_name "($sort_order == 'd' ? 'desc' : '')", pd.products_name";.

         break;.

Case 'PRODUCT_LIST_EMPLOYER':.

          $listing_sql .= "e.employers_name "($sort_order == 'd' ? 'desc' : '')", pd.products_name";.

         break;.

When I try & add the query to the same to the.

// show the products of a specified manufacturer.

   if (isset($HTTP_GET_VARS['manufacturers_id'])) {.

     if (isset($HTTP_GET_VARS['filter_id'])) {.

// We are asked to show only a specific category.

       $listing_sql = "select "$select_column_list" p.products_id, p.manufacturers_id, p.employers_id, p.products_price, p.products_tax_class_id, IF(s.status, s.specials_new_products_price, NULL) as specials_new_products_price, IF(s.status, s.specials_new_products_price, p.products_price) as final_price from "TABLE_PRODUCTS" p, "TABLE_PRODUCTS_DESCRIPTION" pd, "TABLE_MANUFACTURERS" m, "TABLE_PRODUCTS_TO_CATEGORIES" p2c left join "TABLE_SPECIALS" s on p.products_id = s.products_id where p.products_status = '1' and p.manufacturers_id = m.manufacturers_id and m.manufacturers_id = '"$HTTP_GET_VARS['manufacturers_id']"' and p.products_id = p2c.products_id and pd.products_id = p2c.products_id and pd.language_id = '"$languages_id"' and p2c.categories_id = '"$HTTP_GET_VARS['filter_id']"'";.

     } else {.

// We show them all.

       $listing_sql = "select "$select_column_list" p.products_id, p.manufacturers_id, p.employers_id, p.products_price, p.products_tax_class_id, IF(s.status, s.specials_new_products_price, NULL) as specials_new_products_price, IF(s.status, s.specials_new_products_price, p.products_price) as final_price from "TABLE_PRODUCTS" p, "TABLE_PRODUCTS_DESCRIPTION" pd, "TABLE_MANUFACTURERS" m left join "TABLE_SPECIALS" s on p.products_id = s.products_id where p.products_status = '1' and pd.products_id = p.products_id and pd.language_id = '"$languages_id"' and p.manufacturers_id = m.manufacturers_id and m.manufacturers_id = '"$HTTP_GET_VARS['manufacturers_id']"'";.

     }.

This is the part where I get lost.

I've tried.

As final_price from "TABLE_PRODUCTS" p, "TABLE_PRODUCTS_DESCRIPTION" pd, "TABLE_MANUFACTURERS" m, "TABLE_EMPLOYERS" e, " ..

Etc.

But I get unknown table error 'e'.

Please can someone help & explain where I'm going wrong as this is the only part that I need to finish.

Thanks in advance.

Dave..

Comment #26

Please, has anyone have any idea how to make the query work?..

Comment #27

Have you added a define in database_tables.php for the new table you created?..

Comment #28

Mugitty,.

Thanks for your reply,.

Yes, the tables & filenames are defined, the tables work for the product info pages, but I'm trying to get the same to show in the product listing & the advanced search result etc..

Comment #29

This may not solve the problem, but in the code above you show.

Shouldn't that be.

?..

Comment #30

Already tried that, but didn't work.

I can get the employer_id to display if I tweak the code, but echo the employer_id from table products in the product listing, but for the life of me, I can get the code to display the employer_name from table employer in product listing.

I do have this working in the product info page though which is the frustrating part of it.

Thanks mugitty all of your suggestions are appreciated..

Comment #31

Perhaps you could try not using "e" but e.g. "emp". Since "e" is used for other things too, it might just confuse MySQL?..

Comment #32

JanZ,.

I always thought that you needed the first letter of the table in the query?.

P - products.

Pd - products description.

M - manfacturer.

Mi - manfacturer info.

E -employer.

Ei - employers info.

Etc ....?..

Comment #33

Can you post the working query as it is for the product_info page?..

Comment #34

Mugitty, Here it is.

<?php  $employers_query = tep_db_query("select e.employers_id, e.employers_name, e.employers_image from "TABLE_EMPLOYERS" e, "TABLE_PRODUCTS" p  where p.products_id = '"$HTTP_GET_VARS['products_id']"' and p.employers_id = e.employers_id"); ?>.

 .

<?php  $temp1 = tep_db_fetch_array($employers_query); ?>.

<?php echo $temp1['employers_name']; ?></font></td>.

Thanks..

Comment #35

I thought it might be helpful to post the queries from the index.

// We show them all.

       $listing_sql = "select "$select_column_list" p.products_id, p.manufacturers_id, p.employers_id, p.products_price, p.products_tax_class_id, IF(s.status, s.specials_new_products_price, NULL) as specials_new_products_price, IF(s.status, s.specials_new_products_price, p.products_price) as final_price from "TABLE_PRODUCTS" p, "TABLE_PRODUCTS_DESCRIPTION" pd, "TABLE_EMPLOYERS" e, "TABLE_MANUFACTURERS" m left join "TABLE_SPECIALS" s on p.products_id = s.products_id where p.products_status = '1' and pd.products_id = p.products_id and pd.language_id = '"$languages_id"' and p.manufacturers_id = m.manufacturers_id and m.manufacturers_id = '"$HTTP_GET_VARS['manufacturers_id']"'";.

     }.

From the product listing.

Case 'PRODUCT_LIST_EMPLOYER':.

           $lc_align = '';.

           $lc_text = '<b>Employer type:</b> <a title="Show all '$listing['employers_name']' vacancies" href="'tep_href_link(FILENAME_DEFAULT, 'employers_id='$listing['employers_id'])'">'$listing['employers_name']'</a>&nbsp;<tr>';.

           break;  ..

Comment #36

Sorry, I've just looked at another query that may be the problem in the index.

// We show them all.

       $listing_sql = "select "$select_column_list" p.products_id, p.manufacturers_id, p.employers_id, p.products_price, p.products_tax_class_id, IF(s.status, s.specials_new_products_price, NULL) as specials_new_products_price, IF(s.status, s.specials_new_products_price, p.products_price) as final_price from "TABLE_PRODUCTS_DESCRIPTION" pd, "TABLE_PRODUCTS" p left join "TABLE_MANUFACTURERS" m on p.manufacturers_id = m.manufacturers_id, "TABLE_EMPLOYERS" e on p.employers_id = e.employers_id, "TABLE_PRODUCTS_TO_CATEGORIES" p2c left join "TABLE_SPECIALS" s on p.products_id = s.products_id where p.products_status = '1' and p.products_id = p2c.products_id and pd.products_id = p2c.products_id and pd.language_id = '"$languages_id"' and p2c.categories_id = '"$current_category_id"'";.

     }..

Comment #37

The "case" example you showed above ($listing_sql) is the second one that appears in index.php.

There is a prior case statement before the select statement named "$select_column_list" (around line 146 in an unmodified file).

Did you add a case for employer to that one?..

Comment #38

Here are all the querys for listing_sql.

// show the products of a specified manufacturer.

   if (isset($HTTP_GET_VARS['manufacturers_id'])) {.

     if (isset($HTTP_GET_VARS['filter_id'])) {.

// We are asked to show only a specific category.

       $listing_sql = "select "$select_column_list" p.products_id, p.manufacturers_id, p.employers_id, p.products_price, p.products_tax_class_id, IF(s.status, s.specials_new_products_price, NULL) as specials_new_products_price, IF(s.status, s.specials_new_products_price, p.products_price) as final_price from "TABLE_PRODUCTS" p, "TABLE_PRODUCTS_DESCRIPTION" pd, "TABLE_MANUFACTURERS" m, "TABLE_EMPLOYERS" e, "TABLE_PRODUCTS_TO_CATEGORIES" p2c left join "TABLE_SPECIALS" s on p.products_id = s.products_id where p.products_status = '1' and p.manufacturers_id = m.manufacturers_id and m.manufacturers_id = '"$HTTP_GET_VARS['manufacturers_id']"' and p.products_id = p2c.products_id and pd.products_id = p2c.products_id and pd.language_id = '"$languages_id"' and p2c.categories_id = '"$HTTP_GET_VARS['filter_id']"'";.

     } else {.

// We show them all.

       $listing_sql = "select "$select_column_list" p.products_id, p.manufacturers_id, p.employers_id, p.products_price, p.products_tax_class_id, IF(s.status, s.specials_new_products_price, NULL) as specials_new_products_price, IF(s.status, s.specials_new_products_price, p.products_price) as final_price from "TABLE_PRODUCTS" p, "TABLE_PRODUCTS_DESCRIPTION" pd, "TABLE_EMPLOYERS" e, "TABLE_MANUFACTURERS" m left join "TABLE_SPECIALS" s on p.products_id = s.products_id where p.products_status = '1' and pd.products_id = p.products_id and pd.language_id = '"$languages_id"' and p.manufacturers_id = m.manufacturers_id and m.manufacturers_id = '"$HTTP_GET_VARS['manufacturers_id']"'";.

     }.

// We build the categories-dropdown.

     $filterlist_sql = "select distinct c.categories_id as id, cd.categories_name as name from "TABLE_PRODUCTS" p, "TABLE_PRODUCTS_TO_CATEGORIES" p2c, "TABLE_CATEGORIES" c, "TABLE_CATEGORIES_DESCRIPTION" cd where p.products_status = '1' and p.products_id = p2c.products_id and p2c.categories_id = c.categories_id and p2c.categories_id = cd.categories_id and cd.language_id = '"$languages_id"' and p.manufacturers_id = '"$HTTP_GET_VARS['manufacturers_id']"' order by cd.categories_name";.

   } else {.

// show the products in a given categorie.

     if (isset($HTTP_GET_VARS['filter_id'])) {.

// We are asked to show only specific catgeory.

       $listing_sql = "select "$select_column_list" p.products_id, p.manufacturers_id, p.employers_id, p.products_price, p.products_tax_class_id, IF(s.status, s.specials_new_products_price, NULL) as specials_new_products_price, IF(s.status, s.specials_new_products_price, p.products_price) as final_price from "TABLE_PRODUCTS" p, "TABLE_PRODUCTS_DESCRIPTION" pd, "TABLE_MANUFACTURERS" m, "TABLE_PRODUCTS_TO_CATEGORIES" p2c left join "TABLE_SPECIALS" s on p.products_id = s.products_id where p.products_status = '1' and p.manufacturers_id = m.manufacturers_id and m.manufacturers_id = '"$HTTP_GET_VARS['filter_id']"' and p.products_id = p2c.products_id and pd.products_id = p2c.products_id and pd.language_id = '"$languages_id"' and p2c.categories_id = '"$current_category_id"'";.

     } else {.

// We show them all.

       $listing_sql = "select "$select_column_list" p.products_id, p.manufacturers_id, p.employers_id, p.products_price, p.products_tax_class_id, IF(s.status, s.specials_new_products_price, NULL) as specials_new_products_price, IF(s.status, s.specials_new_products_price, p.products_price) as final_price from "TABLE_PRODUCTS_DESCRIPTION" pd, "TABLE_PRODUCTS" p left join "TABLE_MANUFACTURERS" m on p.manufacturers_id = m.manufacturers_id, "TABLE_PRODUCTS_TO_CATEGORIES" p2c left join "TABLE_SPECIALS" s on p.products_id = s.products_id where p.products_status = '1' and p.products_id = p2c.products_id and pd.products_id = p2c.products_id and pd.language_id = '"$languages_id"' and p2c.categories_id = '"$current_category_id"'";.

     }.

// We build the manufacturers Dropdown.

     $filterlist_sql= "select distinct m.manufacturers_id as id, m.manufacturers_name as name from "TABLE_PRODUCTS" p, "TABLE_PRODUCTS_TO_CATEGORIES" p2c, "TABLE_MANUFACTURERS" m where p.products_status = '1' and p.manufacturers_id = m.manufacturers_id and p.products_id = p2c.products_id and p2c.categories_id = '"$current_category_id"' order by m.manufacturers_name";.

   }..

Comment #39

I've found the select statement.

// create column list.

   $define_list = array('PRODUCT_LIST_VACANCY' => PRODUCT_LIST_VACANCY,.

                        'PRODUCT_LIST_NAME' => PRODUCT_LIST_NAME,.

// ################### Products Description Hack begins #######################.

                      'PRODUCT_LISTING_DESCRIPTION' => PRODUCT_LISTING_DESCRIPTION,.

// ################### Products Description Hack ends ###################.

            'PRODUCT_LIST_SALARY' => PRODUCT_LIST_SALARY,.

            'PRODUCT_LIST_MANUFACTURER' => PRODUCT_LIST_MANUFACTURER,.

         'PRODUCT_LIST_EMPLOYER' => PRODUCT_LIST_EMPLOYER,.

                        'PRODUCT_LIST_PRICE' => PRODUCT_LIST_PRICE,.

            'PRODUCT_LIST_WEIGHT' => PRODUCT_LIST_WEIGHT,.

                        'PRODUCT_LIST_IMAGE' => PRODUCT_LIST_IMAGE,.

                        'PRODUCT_LIST_BUY_NOW' => PRODUCT_LIST_BUY_NOW);.

   asort($define_list);.

   $column_list = array();.

   reset($define_list);.

   while (list($column, $value) = each($define_list)) {.

     if ($value) $column_list[] = $column;.

   }.

   $select_column_list = '';.

   for ($col=0, $n=sizeof($column_list); $col<$n; $col++) {.

     if ( ($column_list[$col] == 'PRODUCT_LIST_BUY_NOW') || ($column_list[$col] == 'PRODUCT_LIST_PRICE') ) {.

       continue;.

     }.

     if (tep_not_null($select_column_list)) {.

       $select_column_list .= ', ';.

     }.

     switch ($column_list[$col]) {.

       case 'PRODUCT_LIST_VACANCY':.

         $select_column_list .= 'p.products_vacancy';.

         break;.

   case 'PRODUCT_LIST_NAME':.

         $select_column_list .= 'pd.products_name';.

         break;  .

   // Products Description Hack begins.

       case 'PRODUCT_LISTING_DESCRIPTION':.

  $select_column_list .= 'pd.products_description';.

         break;.

// Products Description Hack ends  .

       case 'PRODUCT_LIST_MANUFACTURER':.

         $select_column_list .= 'm.manufacturers_name';.

         break;.

      case 'PRODUCT_LIST_EMPLOYER':.

         $select_column_list .= 'e.employers_name';.

         break;.

   case 'PRODUCT_LIST_SALARY':.

         $select_column_list .= 'p.products_salary';.

         break;.

       case 'PRODUCT_LIST_IMAGE':.

         $select_column_list .= 'p.products_image';.

         break;.

       case 'PRODUCT_LIST_WEIGHT':.

         $select_column_list .= 'p.products_weight';.

         break;.

     }.

   }.

   if (tep_not_null($select_column_list)) {.

     $select_column_list .= ', ';.

   }..

Comment #40

I'm getting closer, I can get the employers_name to show but now the product is repeated for the same vacancy 9 times as I have 9 employer types.

// We show them all.

       $listing_sql = "select "$select_column_list" p.products_id, p.manufacturers_id, p.employers_id, p.products_price, p.products_tax_class_id, IF(s.status, s.specials_new_products_price, NULL) as specials_new_products_price, IF(s.status, s.specials_new_products_price, p.products_price) as final_price from "TABLE_PRODUCTS_DESCRIPTION" pd, "TABLE_PRODUCTS" p left join "TABLE_MANUFACTURERS" m on p.manufacturers_id = m.manufacturers_id, "TABLE_EMPLOYERS" e, "TABLE_PRODUCTS_TO_CATEGORIES" p2c left join "TABLE_SPECIALS" s on p.products_id = s.products_id where p.products_status = '1' and p.products_id = p2c.products_id and pd.products_id = p2c.products_id and pd.language_id = '"$languages_id"' and p2c.categories_id = '"$current_category_id"'";.

     }.

I think it's something to do with this part of the query.

TABLE_MANUFACTURERS" m on p.manufacturers_id = m.manufacturers_id, "TABLE_EMPLOYERS" e, " ...

Comment #41

No, aliases can be any length up till 256 characters. See e.g. Paul DuBois' book on MySQL:.

Http://www.samspubli...cle.asp?p=30875.

But if in this case the use of "e" is causing your problem, I really wouldn't know (I guess not)...

Comment #42

JanZ,.

Thanks for clarifying that.

Any idea what's wrong with the query & why it repeats, I have looked through all the files & the alias "e" isn't used so I guess it must be the query that's wrong?..

Comment #43

I haven't done my best to think deeply about this, neither am I an SQL-expert, but just for the heck of it, try: "... e left join, "..

Comment #44

Another shot in the dark, what about:.

TABLE_EMPLOYERS" e on p.employers_id=e.employers_id,..

Comment #45

JanZ.

I did try to add those querys but they came up with errors,.

Your suggestions are appreciated..

Comment #46

On trying to figure out what you want to do, I get the idea that things should be a lot more complicated than just adding "TABLE_EMPLOYERS e". Correct me if I'm wrong but are you trying to do with the drop-down list essentially what the manufacturers drop-down list is doing?.

If you don't need the manufacturers (I guess it might, looking at the type of iPage site you are building) you could just change the table names and fields and HTTP_VARS from manufacturers to the equivalent things from the employers table..

If you *do* need the manufacturers drop-down list, things get way more complicated. In your code you are not taking into account the HTTP_VARS that is generated from the drop-down list of the employers_type. The original code is looking at: if a manufacturer is chosen, then look up the products that come from that manufacturer else show all products..

You would be looking into: if a manufacturer is chosen { if an employer type is chosen then, else ... } else { if an employer type is chosen then, else ...}..

Did I understand correctly what you are trying to accomplish?..

Comment #47


This question was taken from a support group/message board and re-posted here so others can learn from it.