Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Recommended Posts

Posted (edited)

@@Dan Cole

No, i have the fail described above.

 Call to undefined function tep_get_languages() in /httpdocs/faq.php on line 17
Edited by Lioelx

No external links here, thank you

Posted

@@Lioelx So do you have the function tep_get_languages() in the includes/function/general.php on the catalogue side of the shop?

 

Dan

@@Dan Cole, No, only on admin side. The original 2.3.4 dont hav the function on cataloge side, i put the function on catalog/includes/functions/general.php and the code made dissaper all the page excep header an footer.

this ist the function, i think...

  function tep_get_languages() {
    $languages_query = tep_db_query("select languages_id, name, code, image, directory from " . TABLE_LANGUAGES . " order by sort_order");
    while ($languages = tep_db_fetch_array($languages_query)) {
      $languages_array[] = array('id' => $languages['languages_id'],
                                 'name' => $languages['name'],
                                 'code' => $languages['code'],
                                 'image' => $languages['image'],
                                 'directory' => $languages['directory']);
    }

    return $languages_array;
  }

No external links here, thank you

Posted

i dont see this on footer:

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 'select f.faq_id, fd.faq_question, fd.faq_answer, f.last_modified, f.sort_order, ' at line 1

select count(select f.faq_id, fd.faq_question, fd.faq_answer, f.last_modified, f.sort_order, f.faq_status from faq f, faq_description fd where f.faq_id=fd.faq_id and fd.language_id=3 order by f.sort_order, fd.faq_id) as total

[TEP STOP]

TABLE_HEADING_FAQ_PREV	TABLE_HEADING_FAQ_QUESTION	TABLE_HEADING_FAQ_STATUS	TABLE_HEADING_FAQ_LAST_MODIFIED

And this the sql query

CREATE TABLE `faq` (
  `faq_id` int(11) NOT NULL auto_increment,
  `faq_status` tinyint(1) NOT NULL default '1',
  `sort_order` int(11) NOT NULL default '0',
  `last_modified` datetime NOT NULL,
  PRIMARY KEY  (`faq_id`)
) ENGINE=MyISAM  DEFAULT CHARSET=utf8;

CREATE TABLE `faq_description` (
  `faq_id` int(11) NOT NULL,
  `language_id` int(11) NOT NULL,
  `faq_question` text,
  `faq_answer` text,
  PRIMARY KEY  (`faq_id`,`language_id`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8;

No external links here, thank you

Posted

catalog/admin/languages.php

// create additional FAQ language records
        $faq_query = tep_db_query("select f.faq_id, fd.faq_question, fd.faq_answer from faq f left join faq_description fd on f.faq_id = fd.faq_id where fd.language_id = '" . (int)$languages_id . "'");
        while ($faq = tep_db_fetch_array($faq_query)) {
          tep_db_query("insert into faq_description (faq_id, language_id, faq_question, faq_answer) values ('" . (int)$faq['faq_id'] . "', '" . (int)$insert_id . "', '" . tep_db_input($faq['faq_question']) . "', '" . tep_db_input($faq['faq_answer']) . "')");
        }

No external links here, thank you

Posted

@@Lioelx  You lost me....so you added the function on the catalogue side and the error went away...that makes sense.  Now you're wondering if it's the right function?   The instructions on installing the add-on should guide you through that....I'm guessing that you just put the function in the wrong general.php file when you installed it.

 

Dan

Posted

Hi @@Dan Cole, sorry for my bad explain.

I write the funcion on catalog/includes/functios/general.php install manual dont explain nothign to this.

Whit the funcion the error

Call to undefined function tep_get_languages() in /httpdocs/faq.php on line 17

is solved but....

Now show this fail:

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 'select f.faq_id, fd.faq_question, fd.faq_answer, f.last_modified, f.sort_order, ' at line 1

select count(select f.faq_id, fd.faq_question, fd.faq_answer, f.last_modified, f.sort_order, f.faq_status from faq f, faq_description fd where f.faq_id=fd.faq_id and fd.language_id=3 order by f.sort_order, fd.faq_id) as total 

this sentences are in catalog/admin/languages.php (manual installation)

// create additional FAQ language records
        $faq_query = tep_db_query("select f.faq_id, fd.faq_question, fd.faq_answer from faq f left join faq_description fd on f.faq_id = fd.faq_id where fd.language_id = '" . (int)$languages_id . "'");
        while ($faq = tep_db_fetch_array($faq_query)) {
          tep_db_query("insert into faq_description (faq_id, language_id, faq_question, faq_answer) values ('" . (int)$faq['faq_id'] . "', '" . (int)$insert_id . "', '" . tep_db_input($faq['faq_question']) . "', '" . tep_db_input($faq['faq_answer']) . "')");
        }

Or its caused whit the function... i dont know:

  function tep_get_languages() {
    $languages_query = tep_db_query("select languages_id, name, code, image, directory from " . TABLE_LANGUAGES . " order by sort_order");
    while ($languages = tep_db_fetch_array($languages_query)) {
      $languages_array[] = array('id' => $languages['languages_id'],
                                 'name' => $languages['name'],
                                 'code' => $languages['code'],
                                 'image' => $languages['image'],
                                 'directory' => $languages['directory']);
    }

    return $languages_array;
  }

Regards

No external links here, thank you

Posted

@@Lioelx my guess is that you're getting that error on a page that is supposed to show a list of FAQs. Is that right?

 

It looks like it's when the query is run from the paging logic to see if the results will fit on one page or not, so you won't find the exact query in the code anywhwere.

 

However, the syntax looks ok to me, so the most likely cause of the error is that you haven't applied changes to the database that you were supposed to.

Contact me for work on updating existing stores - whether to Phoenix or the new osC when it's released.

Looking for a payment or shipping module? Maybe I've already done it.

Working on generalising bespoke solutions for Quickbooks integration, Easify integration and pay4later (DEKO) integration at 2.3.x

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...