ce7 8 Posted March 7 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
Jack_mcs 1,116 Posted March 7 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
ce7 8 Posted March 8 @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
Jack_mcs 1,116 Posted March 8 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
petsk 0 Posted March 8 Is this actual code for osC v4? If so, I’m shocked. Share this post Link to post Share on other sites
Hotclutch 191 Posted March 9 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. 1 petsk reacted to this Share this post Link to post Share on other sites