Latest News: (loading..)
Kolingua

Discussion about Hard Coded Database Tables

44 posts in this topic

Database tables' names are hardcoded in line 36 of catalog/includes/modules/boxes/bm_specials.php, it should be changed to

      if ($random_product = tep_random_select("select p.products_id, pd.products_name, p.products_price, p.products_tax_class_id, p.products_image, s.specials_new_products_price from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd, " . TABLE_SPECIALS . " s where p.products_status = '1' and p.products_id = s.products_id and pd.products_id = s.products_id and pd.language_id = '" . (int)$languages_id . "' and s.status = '1' order by s.specials_date_added desc limit " . MAX_RANDOM_SELECT_SPECIALS)) {
Edited by figuera

Share this post


Link to post
Share on other sites

@ - database names and filenames should be hardcoded.  

 

/includes/filenames.php and /includes/database_tables.php are deprecated.

Share this post


Link to post
Share on other sites

@ - database names and filenames should be hardcoded.  

 

/includes/filenames.php and /includes/database_tables.php are deprecated.

 

Deprecated as a general osC policy? Do you mean that these files will be suppressed in next versions of osC and file and table names will be hardcoded everywhere and thus not changeable?

Edited by figuera

Share this post


Link to post
Share on other sites

Deprecated as a general osC policy? Do you mean that these files will be suppressed in next versions of osC and file and table names will be hardcoded everywhere and thus not changeable?

yes, that is apparently the current line of thinking, personally I don't like it either as I rely on some level of abstraction for the database.

I personally don't have issues with the filenames being hardcoded - maybe we should organize a community poll ?

Kolingua likes this

Share this post


Link to post
Share on other sites

Deprecated as a general osC policy? Do you mean that these files will be suppressed in next versions of osC and file and table names will be hardcoded everywhere and thus not changeable?

 

Yes.

Share this post


Link to post
Share on other sites

yes, that is apparently the current line of thinking, personally I don't like it either as I rely on some level of abstraction for the database.

I personally don't have issues with the filenames being hardcoded - maybe we should organize a community poll ?

Changing the file names may make sense for a store whose default language is other than English, and unique table names may provide a little extra protection against SQL injection attacks. A poll seems a good idea.

Share this post


Link to post
Share on other sites

@@bruyndoncx

@

 

Imagine for your account_edit.php you never need to touch :

<?php
	/*
		$Id$
		
		osCommerce, Open Source E-Commerce Solutions
		http://www.oscommerce.com
		
		Copyright (c) 2015 osCommerce
		
		Released under the GNU General Public License
	*/
	
	require('includes/application_top.php');
	
	echo $oscTemplate->getPageContent('account_edit');  
	
	require(DIR_WS_INCLUDES . 'application_bottom.php');
?>

Then for the pageContent being called pg_account_edit.php you wil never need to touch (if we get more classes to get rid of the globals) :

<?php
	/*
		$Id$
		
		osCommerce, Open Source E-Commerce Solutions
		http://www.oscommerce.com
		
		Copyright (c) 2015 osCommerce
		
		Released under the GNU General Public License
	*/
	
	class pg_account_edit {
		var $group = 'account_edit';
		
		function prepare() {
			global $navigation, $breadcrumb, $oscTemplate;
			
			if (!tep_session_is_registered('customer_id')) {
				$navigation->set_snapshot();
				tep_redirect(tep_href_link(FILENAME_LOGIN, '', 'SSL'));
			}
			
			$breadcrumb->add(NAVBAR_TITLE_1, tep_href_link(FILENAME_ACCOUNT, '', 'SSL'));
			$breadcrumb->add(NAVBAR_TITLE_2, tep_href_link($this->group . '.php', '', 'SSL'));			
		}
		
		function buildtop() {
			global $messageStack, $oscTemplate;
			
			ob_start();
			if (file_exists('includes/templates/' . TEMPLATE . '/template_top.php') && file_exists('includes/templates/' . TEMPLATE . '/template_bottom.php')) {
				require('includes/templates/' . TEMPLATE . '/template_top.php');
				} else {
				require(DIR_WS_INCLUDES . 'template_top.php');
			}
			require('includes/form_check.js.php');			
			$data = ob_get_clean();                 
			
			$oscTemplate->addPageContent($data, $this->group);		
		}
		
		function build() {
			global $HTTP_POST_VARS, $customer_id, $customer_default_address_id, $messageStack, $sessiontoken, $oscTemplate;
			
			require('includes/modules/pages/pg_actions/' . $this->group . '.php');			
			
			ob_start();
			if (file_exists('includes/templates/' . TEMPLATE . '/modules/pages/tpl_' . $this->group . '.php')) {
				include('includes/templates/' . TEMPLATE . '/modules/pages/tpl_' . $this->group . '.php');
				} else {
				include(DIR_WS_MODULES . 'pages/templates/tpl_' . $this->group . '.php');
			}
			$data = ob_get_clean();                 
			
			$oscTemplate->addPageContent($data, $this->group);
		}
		
		function buildbottom() {
			global $oscTemplate;
			
			ob_start();
			if (file_exists('includes/templates/' . TEMPLATE . '/template_bottom.php') && file_exists('includes/templates/' . TEMPLATE . '/template_top.php')) {
				require('includes/templates/' . TEMPLATE . '/template_bottom.php');
				} else {
				require(DIR_WS_INCLUDES . 'template_bottom.php');
			}
			$data = ob_get_clean();                 
			
			$oscTemplate->addPageContent($data, $this->group);			
		}		
	}
?>

Because this is a CRUD based page (Create-Read-Update-Delete) we require an action file called in function build() :

require('includes/modules/pages/pg_actions/' . $this->group . '.php');

So inside that file named now as account_edit.php ($this->group == account_edit) we have:

<?php
	
	global $HTTP_POST_VARS, $customer_id, $customer_default_address_id, $messageStack, $sessiontoken, $oscTemplate;
	
	if (isset($HTTP_POST_VARS['action']) && ($HTTP_POST_VARS['action'] == 'process') && isset($HTTP_POST_VARS['formid']) && ($HTTP_POST_VARS['formid'] == $sessiontoken)) {
		if (ACCOUNT_GENDER == 'true') $gender = tep_db_prepare_input($HTTP_POST_VARS['gender']);
		$firstname = tep_db_prepare_input($HTTP_POST_VARS['firstname']);
		$lastname = tep_db_prepare_input($HTTP_POST_VARS['lastname']);
		if (ACCOUNT_DOB == 'true') $dob = tep_db_prepare_input($HTTP_POST_VARS['dob']);
		$email_address = tep_db_prepare_input($HTTP_POST_VARS['email_address']);
		$telephone = tep_db_prepare_input($HTTP_POST_VARS['telephone']);
		$fax = tep_db_prepare_input($HTTP_POST_VARS['fax']);
		
		$error = false;
		
		if (ACCOUNT_GENDER == 'true') {
			if ( ($gender != 'm') && ($gender != 'f') ) {
				$error = true;
				
				$messageStack->add('account_edit', ENTRY_GENDER_ERROR);
			}
		}
		
		if (strlen($firstname) < ENTRY_FIRST_NAME_MIN_LENGTH) {
			$error = true;
			
			$messageStack->add('account_edit', ENTRY_FIRST_NAME_ERROR);
		}
		
		if (strlen($lastname) < ENTRY_LAST_NAME_MIN_LENGTH) {
			$error = true;
			
			$messageStack->add('account_edit', ENTRY_LAST_NAME_ERROR);
		}
		
		if (ACCOUNT_DOB == 'true') {
			if ((strlen($dob) < ENTRY_DOB_MIN_LENGTH) || (!empty($dob) && (!is_numeric(tep_date_raw($dob)) || !@checkdate(substr(tep_date_raw($dob), 4, 2), substr(tep_date_raw($dob), 6, 2), substr(tep_date_raw($dob), 0, 4))))) {
				$error = true;
				
				$messageStack->add('account_edit', ENTRY_DATE_OF_BIRTH_ERROR);
			}
		}
		
		if (strlen($email_address) < ENTRY_EMAIL_ADDRESS_MIN_LENGTH) {
			$error = true;
			
			$messageStack->add('account_edit', ENTRY_EMAIL_ADDRESS_ERROR);
		}
		
		if (!tep_validate_email($email_address)) {
			$error = true;
			
			$messageStack->add('account_edit', ENTRY_EMAIL_ADDRESS_CHECK_ERROR);
		}
		
		$check_email_query = tep_db_query("select count(*) as total from " . TABLE_CUSTOMERS . " where customers_email_address = '" . tep_db_input($email_address) . "' and customers_id != '" . (int)$customer_id . "'");
		$check_email = tep_db_fetch_array($check_email_query);
		if ($check_email['total'] > 0) {
			$error = true;
			
			$messageStack->add('account_edit', ENTRY_EMAIL_ADDRESS_ERROR_EXISTS);
		}
		
		if (strlen($telephone) < ENTRY_TELEPHONE_MIN_LENGTH) {
			$error = true;
			
			$messageStack->add('account_edit', ENTRY_TELEPHONE_NUMBER_ERROR);
		}
		
		if ($error == false) {
			$sql_data_array = array('customers_firstname' => $firstname,
			'customers_lastname' => $lastname,
			'customers_email_address' => $email_address,
			'customers_telephone' => $telephone,
			'customers_fax' => $fax);
			
			if (ACCOUNT_GENDER == 'true') $sql_data_array['customers_gender'] = $gender;
			if (ACCOUNT_DOB == 'true') $sql_data_array['customers_dob'] = tep_date_raw($dob);
			
			tep_db_perform(TABLE_CUSTOMERS, $sql_data_array, 'update', "customers_id = '" . (int)$customer_id . "'");
			
			tep_db_query("update " . TABLE_CUSTOMERS_INFO . " set customers_info_date_account_last_modified = now() where customers_info_id = '" . (int)$customer_id . "'");
			
			$sql_data_array = array('entry_firstname' => $firstname,
			'entry_lastname' => $lastname);
			
			tep_db_perform(TABLE_ADDRESS_BOOK, $sql_data_array, 'update', "customers_id = '" . (int)$customer_id . "' and address_book_id = '" . (int)$customer_default_address_id . "'");
			
			// reset the session variables
			$customer_first_name = $firstname;
			
			$messageStack->add_session('account', SUCCESS_ACCOUNT_UPDATED, 'success');
			
			tep_redirect(tep_href_link(FILENAME_ACCOUNT, '', 'SSL'));
		}
	}
	
	$account_query = tep_db_query("select customers_gender, customers_firstname, customers_lastname, customers_dob, customers_email_address, customers_telephone, customers_fax from " . TABLE_CUSTOMERS . " where customers_id = '" . (int)$customer_id . "'");
	$account = tep_db_fetch_array($account_query);
	
?>

As can see in above file it is the code what is in your default account_edit.php running BEFORE template_top.php

 

And then comes the final html output previously called as well in function build() as:

			ob_start();
			if (file_exists('includes/templates/' . TEMPLATE . '/modules/pages/tpl_' . $this->group . '.php')) {
				include('includes/templates/' . TEMPLATE . '/modules/pages/tpl_' . $this->group . '.php');
				} else {
				include(DIR_WS_MODULES . 'pages/templates/tpl_' . $this->group . '.php');
			}
			$data = ob_get_clean(); 

And then the template file what can be styled by your needs in what ever template :

<div class="page-header">
  <h1><?php echo HEADING_TITLE; ?></h1>
</div>

<?php
  if ($messageStack->size('account_edit') > 0) {
    echo $messageStack->output('account_edit');
  }
?>

<?php echo tep_draw_form('account_edit', tep_href_link(FILENAME_ACCOUNT_EDIT, '', 'SSL'), 'post', 'class="form-horizontal" onsubmit="return check_form(account_edit);"', true) . tep_draw_hidden_field('action', 'process'); ?>

<div class="contentContainer">
  <div class="inputRequirement text-right"><?php echo FORM_REQUIRED_INFORMATION; ?></div>

  <?php
  if (ACCOUNT_GENDER == 'true') {
    if (isset($gender)) {
      $male = ($gender == 'm') ? true : false;
    } else {
      $male = ($account['customers_gender'] == 'm') ? true : false;
    }
    $female = !$male;
  ?>
  <div class="form-group has-feedback">
    <label class="control-label col-sm-3"><?php echo ENTRY_GENDER; ?></label>
    <div class="col-sm-9">
      <label class="radio-inline">
        <?php echo tep_draw_radio_field('gender', 'm', $male, 'required aria-required="true"') . ' ' . MALE; ?>
      </label>
      <label class="radio-inline">
        <?php echo tep_draw_radio_field('gender', 'f', $female) . ' ' . FEMALE; ?>
      </label>
      <?php echo FORM_REQUIRED_INPUT; ?>
      <?php if (tep_not_null(ENTRY_GENDER_TEXT)) echo '<span class="help-block">' . ENTRY_GENDER_TEXT . '</span>'; ?>
    </div>
  </div>
  <?php
  }
  ?>
  <div class="form-group has-feedback">
    <label for="inputFirstName" class="control-label col-sm-3"><?php echo ENTRY_FIRST_NAME; ?></label>
    <div class="col-sm-9">
      <?php echo tep_draw_input_field('firstname', $account['customers_firstname'], 'required aria-required="true" id="inputFirstName" placeholder="' . ENTRY_FIRST_NAME . '"'); ?>
      <?php echo FORM_REQUIRED_INPUT; ?>
    </div>
  </div>
  <div class="form-group has-feedback">
    <label for="inputLastName" class="control-label col-sm-3"><?php echo ENTRY_LAST_NAME; ?></label>
    <div class="col-sm-9">
      <?php echo tep_draw_input_field('lastname', $account['customers_lastname'], 'required aria-required="true" id="inputLastName" placeholder="' . ENTRY_LAST_NAME . '"'); ?>
      <?php echo FORM_REQUIRED_INPUT; ?>
    </div>
  </div>

  <?php
  if (ACCOUNT_DOB == 'true') {
?>
  <div class="form-group has-feedback">
    <label for="inputName" class="control-label col-sm-3"><?php echo ENTRY_DATE_OF_BIRTH; ?></label>
    <div class="col-sm-9">
      <?php echo tep_draw_input_field('dob', tep_date_short($account['customers_dob']), 'required aria-required="true" id="dob" placeholder="' . ENTRY_DATE_OF_BIRTH_TEXT . '"'); ?>
      <?php if (tep_not_null(ENTRY_DATE_OF_BIRTH_TEXT)) echo '<span class="help-block">' . ENTRY_DATE_OF_BIRTH_TEXT . '</span>'; ?>
      <?php echo FORM_REQUIRED_INPUT; ?>
    </div>
  </div>
<?php
  }
?>

  <div class="form-group has-feedback">
    <label for="inputEmail" class="control-label col-sm-3"><?php echo ENTRY_EMAIL_ADDRESS; ?></label>
    <div class="col-sm-9">
      <?php echo tep_draw_input_field('email_address', $account['customers_email_address'], 'required aria-required="true" id="inputEmail" placeholder="' . ENTRY_EMAIL_ADDRESS . '"', 'email'); ?>
      <?php echo FORM_REQUIRED_INPUT; ?>
    </div>
  </div>
  <div class="form-group has-feedback">
    <label for="inputTelephone" class="control-label col-sm-3"><?php echo ENTRY_TELEPHONE_NUMBER; ?></label>
    <div class="col-sm-9">
      <?php echo tep_draw_input_field('telephone', $account['customers_telephone'], 'required aria-required="true" id="inputTelephone" placeholder="' . ENTRY_TELEPHONE_NUMBER . '"', 'tel'); ?>
      <?php echo FORM_REQUIRED_INPUT; ?>
    </div>
  </div>
  <div class="form-group">
    <label for="inputFax" class="control-label col-sm-3"><?php echo ENTRY_FAX_NUMBER; ?></label>
    <div class="col-sm-9">
      <?php echo tep_draw_input_field('fax', $account['customers_fax'], 'id="inputFax" placeholder="' . ENTRY_FAX_NUMBER . '"'); ?>
    </div>
  </div>

  <div class="buttonSet row">
    <div class="col-xs-6"><?php echo tep_draw_button(IMAGE_BUTTON_BACK, 'glyphicon glyphicon-chevron-left', tep_href_link(FILENAME_ACCOUNT, '', 'SSL')); ?></div>
    <div class="col-xs-6 text-right"><?php echo tep_draw_button(IMAGE_BUTTON_CONTINUE, 'glyphicon glyphicon-chevron-right', null, 'primary', null, 'btn-success'); ?></div>
  </div>
</div>

</form>

So looks quite allot, but consider that the last code tpl_account_edit.php is the only file you will ever need to edit.

Share this post


Link to post
Share on other sites

So looks quite allot but consider that the last code tpl_account_edit.php is the only file you will ever need to edit.

 

 

ofcourse inside tpl_account_edit.php you will be able to load the cm_ modules.

Share this post


Link to post
Share on other sites

Changing the file names may make sense for a store whose default language is other than English, and unique table names may provide a little extra protection against SQL injection attacks. A poll seems a good idea.

 

There will be no poll and no further discussion about it.

Share this post


Link to post
Share on other sites

Deprecated as a general osC policy? Do you mean that these files will be suppressed in next versions of osC and file and table names will be hardcoded everywhere and thus not changeable?

 

The reason is index.php based core where no other files to use in catalog. No reason for file names. Files will become module classes. No admin files no catalog files. No file names.

 

 

You will be able do more effective URL SEO than before by languges.

Edited by Gergely
SEO notes
Kolingua likes this

Share this post


Link to post
Share on other sites

@@Gergely, that makes a lot of sense, but table names is a different issue. I agree that this thread is not the place to discuss it, but maybe you can give a good reason in short as you did for filenames, or link to somewhere else it's dealt with.

Share this post


Link to post
Share on other sites

There will be no poll and no further discussion about it.

 

I bet there will and this thread will continue to grow.

Share this post


Link to post
Share on other sites

Some pros and cons of putting file names and table names into macros (defines)

 

+  provides some flexibility that file names and table names could be changed if desired for some reason

+  provides a level of abstraction that makes such names stand out in code

+  by having all names in one place, it makes it easier to avoid accidentally repeating a name for a different purpose (PHP can catch duplicate define names)

+  name could be changed more easily if you need to integrate with other code (e.g., different table names for a sitewide common sign-on)

 

-  very few store owners would bother to change "admin" for security reasons, so I doubt they'll change other files or table names

-  is there any real point to localizing names (non-English languages), since the code is still English (keywords, variable names, comments, and even the define names themselves)?

-  slight performance hit, as the defined name has to be looked up and substituted during compile, in addition to extra string concatenation operations

 

Any others?

Share this post


Link to post
Share on other sites

The issue of table names has been discussed before. I tried to get Harald to give a reason for making this change. He kept dodging the question. I suspect that there is no reason other than "I want to". Unfortunately that seems to be the way osCommerce is being run.

 

I guess the moral is: "Stop asking. You won't get an answer, and nothing is going to change."

 

Regards

Jim

Share this post


Link to post
Share on other sites

Looks like there is further discussion, greeeatttttttttttt  :rolleyes:

 

The reason for deprecating the two files is so that shopowners do not have to amend that core file when they add in addons.  Simple really.  

You want to rename a file or a database table?  It takes less time to do that sitewide, than it will for me to write this post. 

 

If I did not just go ahead and do things - there would have been no progress so far - no-one else stepped up to the plate a year ago and said "let's do this".

 

I ask for peoples input, I get little in return, save for a couple of guys who "get it".  

I ask for peoples help to code, I get nothing in return, save for a couple of guys who "get it".    

I ask for people to test things, I get nothing in return, save for a couple of guys who "get it".    

 

What is so hard to understand;

 

If you give nothing, you get what you're given, when it's given.  

Alternatively you can keep on posting random crap about how osCommerce is so bad and how osCommerce doesn't listen and how osCommerce developers are useless and blah blah blah.  

Alternatively, you can start having positive input and help to bring osCommerce out of the Dark Age.

Edited by burt
wHiTeHaT and Dan Cole like this

Share this post


Link to post
Share on other sites

It finally dawned on me this morning- it is to facilitate extensions to oscommerce without having to touch the core code, otherwise any silly addition would still require a core code change - exactly what we do not want ...

wHiTeHaT likes this

Share this post


Link to post
Share on other sites

I agree that this thread is not the place to discuss it.

 

Now this thread IS the place to discuss it. I said that in another thread and then it was moved here. Thanks and sorry @@burt

Share this post


Link to post
Share on other sites

I mean, the first 11 posts of this thread were first published in http://forums.oscommerce.com/topic/399514-bugs-in-gold-version-of-234-responsive/ and later @@burt moved them here.

@@burt, I understand you feel disappointed and uncredited for your effort, and I'm sorry for having contributed to that, in part due to my lack of experience here.

Anyway, I want to say that I still consider the hardcoding I mentioned as a "bug" in the sense that you claim to mirror osC 2.3.4 and you're not doing so in this point. If I know that in conventional 2.3.4 I can change table names and reflect the new names in /includes/database_tables.php, I expect that I'm able to the same in the bootstrap version. That's how I found the issue: because it didn't work. That this will work differently in future versions of osC is a different issue.

Share this post


Link to post
Share on other sites

@ - database names and filenames should be hardcoded.  

 

/includes/filenames.php and /includes/database_tables.php are deprecated.

 

Related readings:

Share this post


Link to post
Share on other sites

What is needed is for osCommerce to become more popular. That way, it will attract more coders, who will provide more add ons and themes, which will make osCommerce more functional, which will lead to more sales for shop owners.

 

The only way to make osCommerce more popular is to make it easy to use for the average non technical webmaster.

 

In the past, and even up till now, the base code has been relatively easy to install but hard to alter - which has come at a cost. Haphazard add on development, with changes to the core code that causes conflicts, and great difficulty in theming. This results in headaches if people want to alter their osC store (and most osCommerce stores that basically all look the same).

 

What is the motivation for people to create and maintain add ons and themes? To make money, or contribute back to the community. For the former, it is a complete headache to provide support because if a shop owner (or developer) installs add on Y, it interferes with add on X resulting in extra coding work (plus the time it takes to find the problem!). For the latter, the amount of work involved helping out less experienced shop owners makes the whole exercise of "giving back" a tiring and thankless exercise.

 

Look at a program like Wordpress - easy to install, easy to maintain, easy to skin, easy to install add ons - and people are happy to code for it because they know it will just work if they adhere to the standards. osCommerce can be like that. Old time osC users need to change their thinking in this transitional process.

 

Where some us find it a great (and satisfying) challenge to hack the core code to get it to do what we want, we need to look at things differently. How can we add functionality without touching the core code? How can we use hooks, modules and themes to make an exciting and functional shop? We want to get to the stage where the average shop owner won't even need to know what FTP is used for! They should be able to download and install add ons and themes from an osC app store - some may be free and some may be paid. We aren't even half way there yet.

 

We have to let the developers get osC to that "easy" stage. We can make suggestions, test, and in general help wherever we can. The result will be a robust, easy to use eCommerce suite with many more users and stores that have a unique look and feel that will result in what we are looking for - more sales and conversions. Plus developers, add on writers and theme creators should be able to make money, adding even more creativity to the osCommerce ecosystem. 

 

Time to move forward!

Share this post


Link to post
Share on other sites

@@frankl

Nicele, eloquently spoken, and as an 'old school' developer/user I agree, even if it makes my personal setup a little bit more complicated, I can live with the disadvantages, looking at what advantages it will bring for the average store owner/user.

 

@@burt

I suggest we close this thread. 100% agree, time to move forward !

Note, if you really want/need to, you can still re-introduce the database tables layer in your own code. That is the power of opensource ...

Share this post


Link to post
Share on other sites

@@frankl that is a brilliant post, thank you.  I have saved into my favourites and when anyone starts the same conversation I will point them at your post.  Thank You for "getting it"!

frankl likes this

Share this post


Link to post
Share on other sites

Looks like there is further discussion, greeeatttttttttttt  :rolleyes:

 

The reason for deprecating the two files is so that shopowners do not have to amend that core file when they add in addons.  Simple really.  

 

Simple really after you said it, so I don't regret having started this discussion, which has also produced @@frankl's excelent post.

Share this post


Link to post
Share on other sites

Hello,

 

file: includes/modules/boxes/bm_specials.php

 

Line: 33

 

refers to tables by direct name rather than variable name. Thus, if someone modifies includes/database_tables.php to include say a prefect of 'osc_', this breaks.

 

From:

 

if ($random_product = tep_random_select("select p.products_id, pd.products_name, p.products_price, p.products_tax_class_id, p.products_image, s.specials_new_products_price from products p, products_description pd, specials s where p.products_status = '1' and p.products_id = s.products_id and pd.products_id = s.products_id and pd.language_id = '" . (int)$languages_id . "' and s.status = '1' order by s.specials_date_added desc limit " . MAX_RANDOM_SELECT_SPECIALS)) {
Edited by whodah

Share this post


Link to post
Share on other sites

Hrm. I can't get my post to show up in one post? Continued:

 

To:
if ($random_product = tep_random_select("select p.products_id, pd.products_name, p.products_price, p.products_tax_class_id, p.products_image, s.specials_new_products_price from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd, " . TABLE_SPECIALS . " s where p.products_status = '1' and p.products_id = s.products_id and pd.products_id = s.products_id and pd.language_id = '" . (int)$languages_id . "' and s.status = '1' order by s.specials_date_added desc limit " . MAX_RANDOM_SELECT_SPECIALS)) {
 
ought to fix it.
 
Thanks for all your hard work,
-Who Dah?

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now