Results 1 to 10 of 28

Threaded View

  1. #11
    Join Date
    Nov 2005
    Location
    los angeles
    Posts
    2,849
    Plugin Contributions
    11

    Default Re: Query does not return data

    @mc12345678, doing what you will suggest will not solve @johnnyh's issue.

    as far as i can tell, the problem is with the $language_id.

    #1, it does not look like you have the DEFAULT_LANGUAGE set in the admin. that said, it looks to be a hidden configuration.
    #2, it would still not work, as they are using the default language code as opposed to the languages_id.

    the languages_id looks to get set in includes/init_includes/init_languages.php and it looks to be a SESSION variable.

    so first, revert the code to the original. and then i would change the code as such:

    PHP Code:
    //from
    if($_GET['language_id']=='')
    {
    $lang=mysqli_fetch_assoc(mysqli_query("select languages_id from ".DB_PREFIX."languages where code in (select configuration_value from ".DB_PREFIX."configuration where configuration_key='DEFAULT_LANGUAGE')"));
    $language_id=$lang['languages_id'];
    }
    else
    $language_id=$_GET['language_id'];

    //to:
    if($_GET['language_id']=='')
    {
    $language_id=$_SESSION['language_id'];
    }
    else
    $language_id=$_GET['language_id']; 
    in addition, i think once you have the script in its original form (or the new revised form), the following link could work:

    http://artos.dk/zencart/storeya_feed.php?language_id=1

    good luck! let us know how it goes!

    1 last thing, there does look to be some extra spaces in the original mysql query:

    Code:
    select ".DB_PREFIX."products.products_id,products_price,products_price_sorter,products_ image,products_name,products_description,products_url from ".DB_PREFIX."products,".DB_PREFIX."products_description where ".DB_PREFIX."products.products_status='1' and ".DB_PREFIX."products.products_id=".DB_PREFIX."products_description.products _id and ".DB_PREFIX."products_description.language_id='".$language_id."' order by ".DB_PREFIX."products.products_id
    specifically here:

    products_ image

    and

    products_description.products _id

    i would remove those 2 extra spaces.
    Last edited by carlwhat; 30 Jun 2017 at 01:48 PM. Reason: making it slightly clearer...
    author of square Webpay.
    mxWorks now has Apple Pay and Google Pay. donations: venmo or paypal accepted.
    premium consistent excellent support. available for hire.

 

 

Similar Threads

  1. v154 SQL Query Load data into column
    By mike14017 in forum Setting Up Categories, Products, Attributes
    Replies: 5
    Last Post: 12 Aug 2015, 05:55 PM
  2. Custom checkout_shipping data does not post to database
    By mprough in forum General Questions
    Replies: 25
    Last Post: 24 Oct 2012, 09:35 PM
  3. PayPal: Data does not match input character set...
    By Peace Freak in forum Built-in Shipping and Payment Modules
    Replies: 6
    Last Post: 11 Oct 2009, 07:26 AM
  4. Replies: 0
    Last Post: 14 Oct 2008, 08:15 PM
  5. AJAX Requests - how to return just data with no template?
    By moltar in forum General Questions
    Replies: 2
    Last Post: 29 Nov 2007, 04:59 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
disjunctive-egg
Zen-Cart, Internet Selling Services, Klamath Falls, OR