Jump to content

Recommended Posts

Hi Mr. Burton!

Help me please.
I have error in Admin...
 

Attributes
1064 - You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'select pa.* from products_attributes pa left join products_options po on po.prod' at line 1

SELECT COUNT(*) AS total select pa.* from products_attributes pa left join products_options po on po.products_options_id = pa.options_id and po.language_id = 2 left join products_options_values pov on pov.products_options_values_id = pa.options_values_id and pov.language_id = 2 left join products_description pd on pa.products_id = pd.products_id and pd.language_id = 2 order by pd.products_name, po.sort_order, pov.sort_order

 


Support forum for osCommerce in russian language - from Ashkelon. Support since 2002.

Best regards,

Fredi

Share this post


Link to post
Share on other sites

Phoenix Version?
PHP Version?
Page that the error shows on?

At the very least, those details would be required.


Help shape the future of Phoenix; join the Phoenix Club

Share this post


Link to post
Share on other sites

Phoenix 1.0.7.9

PHP  7.3


Support forum for osCommerce in russian language - from Ashkelon. Support since 2002.

Best regards,

Fredi

Share this post


Link to post
Share on other sites

Page   admin/products_attributes.php


Support forum for osCommerce in russian language - from Ashkelon. Support since 2002.

Best regards,

Fredi

Share this post


Link to post
Share on other sites

Works fine in the Demo.

The error message looks like SPR problems - Split Page Results.  That would be the first place for you to make investigations.


Help shape the future of Phoenix; join the Phoenix Club

Share this post


Link to post
Share on other sites

Thank you dear Mr. Burton!

You are my teacher and savior !!!

The bug has been fixed. The Admin page works well.


Support forum for osCommerce in russian language - from Ashkelon. Support since 2002.

Best regards,

Fredi

Share this post


Link to post
Share on other sites

For the benefit of future readers who get a similar problem...you might like to explain what the problem was exactly, and what the solution was.


Help shape the future of Phoenix; join the Phoenix Club

Share this post


Link to post
Share on other sites
16 minutes ago, burt said:

For the benefit of future readers who get a similar problem...you might like to explain what the problem was exactly, and what the solution was.

It's in his other thread: 

 


Always back up before making changes.

Share this post


Link to post
Share on other sites

Dear Mr. Burton, my teacher and savior, here's how the bug was fixed:

File admin/products_attributes.php

Old code: from Line 540
 

<?php
$attributes = sprintf(<<<'EOSQL'
select pa.*
from products_attributes pa
left join products_options po on po.products_options_id = pa.options_id and po.language_id = %1$d
left join products_options_values pov on pov.products_options_values_id = pa.options_values_id and pov.language_id = %1$d
left join products_description pd on pa.products_id = pd.products_id and pd.language_id = %1$d
order by pd.products_name, po.products_options_name, pov.products_options_values_name
EOSQL
 , (int)$languages_id);

  $attributes_split = new splitPageResults($attribute_page, MAX_ROW_LISTS_OPTIONS, $attributes, $attributes_query_numrows);
  ?>

Correct code:

<?php
$attributes = sprintf(<<<'EOSQL'
 SELECT pa.*
 FROM products_attributes pa 
 LEFT JOIN products_options po on po.products_options_id = pa.options_id and po.language_id = %1$d
 LEFT JOIN products_options_values pov on pov.products_options_values_id = pa.options_values_id and pov.language_id = %1$d
 LEFT JOIN products_description pd on pa.products_id = pd.products_id and pd.language_id = %1$d
order by pd.products_name, po.products_options_name, pov.products_options_values_name
EOSQL
, (int)$languages_id);

$attributes_split = new splitPageResults($attribute_page, MAX_ROW_LISTS_OPTIONS, $attributes, $attributes_query_numrows);
?>

The problem is missing spaces and
Replacement left join to LEFT JOIN


Support forum for osCommerce in russian language - from Ashkelon. Support since 2002.

Best regards,

Fredi

Share this post


Link to post
Share on other sites

Phoenix is a modification of OsCommere.
For 19 years, there was free access to the discussion of all its modifications.
Today, access to free discussion of this version of OsCommere is closed.
Nothing wrong. We will study on our own. It takes more time, it adds additional risks associated with the transition of old, working stores to the updated core, it significantly complicates the transition, but it creates an opportunity for store owners who have little time to learn programming and do many things on their own.
Yes. This is hard. It takes a lot of time, but it significantly increases our level of education, our understanding of programming in the PHP, MySQL, JS, Bootstrap and understanding of the concept that lies in the modification of OsCommers with the name Phoenix.

A lot has been done in this version of OsCommers.
The kernel has been rewritten and continues to be modified very competently and up to date. Modifying the kernel creates only one problem: adapting to the kernel several thousand old modules created by the community.
Modules are no longer "certified" by the community. Access to modules is closed.

This is another reason to learn to code. I am very grateful to the creators of Phoenix in a closed club format for making me learn! Thank you very much!

 


Support forum for osCommerce in russian language - from Ashkelon. Support since 2002.

Best regards,

Fredi

Share this post


Link to post
Share on other sites

Why did the error occur?
The reason is my low knowledge of PCP and the formation of queries to MySQL.
I update each new Phoenix release by comparing the files of the old and new versions.
Unfortunately, there are a lot of spaces in the kernel and module files. Spaces are needed, but there are a lot of them, even on blank lines there are many unnecessary spaces.
For the convenience of working with files when comparing them, I, as an amateur, not a professional, clean out all these spaces from the code. This makes things easier when comparing files.

Finally I got an error ... The reason is clearing spaces.
Why hasn't there been such a mistake before?

I found the answer.
Previously, a database query was always written in one line. They were short and very long lines.
In some files of the Phoenix version, parts of the lines began to wrap. This is convenient for working with files, but in this case, spaces have an important function.
I cleaned the files from unnecessary gaps, but at the same time I removed those gaps that the database query had broken.

I got a good lesson in coding and understanding the importance of proper spaces in code.

I created the problem for myself, but with the help of the community, I found my mistake and fixed this error.

Thanks everyone !!!!


Support forum for osCommerce in russian language - from Ashkelon. Support since 2002.

Best regards,

Fredi

Share this post


Link to post
Share on other sites
8 hours ago, kgtee said:

Apparently, we learn much quicker in an open space like in this forum.😆

Pointless remark from someone who removed himself from the Club, who now does not like that he has no access to the Club.  D'oh.

 


Help shape the future of Phoenix; join the Phoenix Club

Share this post


Link to post
Share on other sites
1 hour ago, Fredi said:

Today, access to free discussion of this version of OsCommere is closed.

Access to the Phoenix club is free however a level of respect and manners are expected.

1 hour ago, Fredi said:

Modules are no longer "certified" by the community. Access to modules is closed.

Access to community modules are still free assuming the developer makes them that way. As you know any I update I make available where possible. People who pay a subscription for Phoenix do so to keep the project alive and moving forward, in return @burt releases some modules to those people. Most would still pay if they got nothing in return.

Share this post


Link to post
Share on other sites

Dear Lee Foster,
respect should be mutual.

If Phoenix (modules for Phoenix) is a paid service, please tell the community the truth.

There are owners of actually working shops, whom someone does not respect in the "Club" and denies access to the "Club".

No problems. The Club has its own way of communication. This is the choice of the "Club".
No problems. Communication is central to Phoenix's success.


Support forum for osCommerce in russian language - from Ashkelon. Support since 2002.

Best regards,

Fredi

Share this post


Link to post
Share on other sites

I am one who does not understand how Trump can MAGA by drawing boundaries between America and many countries, starting to build walls around America, quitting a few world organizations and even dividing his own people. I know the glory of America was built on a liberal society, a melting pot for the world people to live in and play, as signified by the Statue of Liberty standing tall at the mouth of the river. Trump prefers to garner the support of a specific group of people, powerful may be, who scratch each others' backs. He instead of making great a country, is making America smaller by the day.

By nature I just do not like to live within walls....Lol

 

Edited by kgtee

Share this post


Link to post
Share on other sites

Walls are OK depending what side you're on, right.  EG:  The illegal occupation of the West Bank by Zionists.

Again, for clarity, because some people are so clouded by other issues;

1 (repeat ONE) person was denied access to the Club
Fewer than 5 have been removed for reasons other than activity - just being troublesome as is evidenced in this thread, or sharking for clients.
A couple of people removed themselves, these sheep should not now be bleating that they have no access.

Live with your choice(s), people.


Help shape the future of Phoenix; join the Phoenix Club

Share this post


Link to post
Share on other sites

Thank you, my dear teacher, for explaining the reason for the removal from the "Club"!

You cannot inflame the interests of customers! DO NOT !!!
You can only inflame the interests of a few people who have privatized 20 years of community work.

Thank you very much from the old Jew!


Support forum for osCommerce in russian language - from Ashkelon. Support since 2002.

Best regards,

Fredi

Share this post


Link to post
Share on other sites
On 10/16/2020 at 8:49 AM, Fredi said:

Thank you, my dear teacher, for explaining the reason for the removal from the "Club"!

You cannot inflame the interests of customers! DO NOT !!!
You can only inflame the interests of a few people who have privatized 20 years of community work.

Thank you very much from the old Jew!

Any serious shop owner should really just learn PHP.  It really isn't difficult and quite empowering. You should never have any fear of changing the core. Putting yourself in a position to be reliant on a developer is rather foolish in my opinion.


The water in a vessel is sparkling; the water in the sea is dark. The small truth has words which are clear; the great truth has great silence.

- Rabindranath Tagore

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

×