Jump to content
ce7

DB1064 Error

Recommended Posts

Hi,

I have manufacturer by letter on 1075 version, and get this error

Fatal error:  DB: [1064] You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near '1' at line 1 from <SELECT COUNT(*) AS total  from addons_installed 1 in

within the code below, I can not see SELECT COUNT(*) AS, can anyone please help to explain why this error and how to fix it? Thanks.

 

	                <?php
                $manufacturer_name_query_start = "select manufacturers_id from manufacturers where manufacturers_name";
                $manufacturer_name_query_end = " limit 1";
                $manufacturer_name_query = $manufacturer_name_query_start . " regexp '^[0-9]'" . $manufacturer_name_query_end;
                $manufacturer_name = tep_db_query($manufacturer_name_query);
                if (tep_db_num_rows($manufacturer_name) > 0) {
                  echo '<a href="' . tep_href_link('manufacturers.php', 'mLetter=num') . '" style="text-decoration:underline;">';
                  if (isset($_GET['mLetter']) && ($_GET['mLetter'] == 'num')) {
                    echo '<strong>';
                  }
                  echo '#';
                  if (isset($_GET['mLetter']) && ($_GET['mLetter'] == 'num')) {
                    echo '</strong>';
                  }
                  echo '</a>' . "\n";
                } else {
                  echo '#' . "\n";
                }
                foreach (range('A', 'Z') as $letter) {
                  $manufacturer_name_query = $manufacturer_name_query_start . " like '" . $letter . "%'" . $manufacturer_name_query_end;
                  $manufacturer_name = tep_db_query($manufacturer_name_query);
                  if (tep_db_num_rows($manufacturer_name) > 0) {
                    echo '<a href="' . tep_href_link('manufacturers.php', 'mLetter=' . $letter) . '" style="text-decoration:underline;">';
                    if (isset($_GET['mLetter']) && ($_GET['mLetter'] == $letter)) {
                      echo '<strong>';
                    }
                    echo $letter;
                    if (isset($_GET['mLetter']) && ($_GET['mLetter'] == $letter)) {
                      echo '</strong>';
                    }
                    echo '</a>' . "\n";
                  } else {
                    echo $letter . "\n";
                  }
                }
                echo '<a href="' . tep_href_link('manufacturers.php') . '" style="text-decoration:underline;">show all</a>' . "\n";
                ?>
	 
	

Share this post


Link to post
Share on other sites
4 hours ago, ce7 said:

where manufacturers_name

You have to define manufacturers_name.


Support Links:

For Hire: Contact me for anything you need help with for your shop: upgrading, hosting, repairs, code written, etc.

Need Help? See this thread and provide the information requested.

How to Upgrade to the latest version

Recommended SEO Addons

Share this post


Link to post
Share on other sites

@Jack_mcs

Thank you for reply.
I can not figure out why WHERE name will relate to

from <SELECT COUNT(*) AS total  from addons_installed

 

Share this post


Link to post
Share on other sites

It's from the first line in the code you posted:

17 hours ago, ce7 said:

$manufacturer_name_query_start = "select manufacturers_id from manufacturers where manufacturers_name";      

 

 


Support Links:

For Hire: Contact me for anything you need help with for your shop: upgrading, hosting, repairs, code written, etc.

Need Help? See this thread and provide the information requested.

How to Upgrade to the latest version

Recommended SEO Addons

Share this post


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

Is this actual code for osC v4? If so, I’m shocked.

Its V2 and the thread should be moved there.

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

×