Results 1 to 5 of 5
  1. #1
    Join Date
    Feb 2008
    Location
    Allen, TX
    Posts
    29
    Plugin Contributions
    0

    Default Database query VS Ajax

    Why does the database query function not work inside the AJAX
    'if ($_REQUEST[...]'?

    If I do not try to include the query, then AJAX works fine. If I include the query outside of the 'if ($_REQUEST..)' then it queries the database fine. Can someone explain why this is?

  2. #2
    Join Date
    Aug 2005
    Location
    Arizona
    Posts
    27,755
    Plugin Contributions
    9

    Default Re: Database query VS Ajax

    Ajax is not part of the default code and you are asking this in the General questions that deals with default code

    You have not stated what it is you are attempting nor what 3rd party addon this might come from

    There is a contributed addons area and most addons have a support thread located there
    Zen-Venom Get Bitten

  3. #3
    Join Date
    Feb 2008
    Location
    Allen, TX
    Posts
    29
    Plugin Contributions
    0

    Default Re: Database query VS Ajax

    There is no third party. I just wanted to add a little AJAX functionality to dynamically change drop down options when an option in another dropdown is changed. This type of behavior is very simple and I have done it many times outside of Zencart but for some reason Zencart does not seem to be AJAX friendly.

  4. #4
    Join Date
    Feb 2008
    Location
    Allen, TX
    Posts
    29
    Plugin Contributions
    0

    Default Re: Database query VS Ajax

    Ok, figured it out. The trick isn't to connect to db outside of the includes...the key is getting js to post directly to the php file when it is in the includes. There is some override for the includes folder that doesnt allow files in includes to be accessed directly unless you work around it. If someone knows off the top of their head where the override is or can explain how it works, please share.

  5. #5
    Join Date
    Feb 2008
    Location
    Allen, TX
    Posts
    29
    Plugin Contributions
    0

    Default Re: Database query VS Ajax

    So there is a wiki that explains the override system. Also, sorry for posting this in the wrong place. If I could delete or move it I would

 

 

Similar Threads

  1. v151 Ajax onSubmit call to write an SQL flag in the database for a particular product
    By Chris Stackhouse in forum General Questions
    Replies: 1
    Last Post: 26 Feb 2015, 06:21 PM
  2. v151 Connecting to the database for Ajax Search... Making it safe.
    By ultimate_zc in forum General Questions
    Replies: 5
    Last Post: 22 Dec 2013, 09:25 PM
  3. Database query help?
    By filmfr3ak in forum General Questions
    Replies: 4
    Last Post: 17 Sep 2009, 04:24 PM
  4. Database Query Related
    By callingrohit in forum General Questions
    Replies: 1
    Last Post: 28 Sep 2008, 08:56 PM
  5. Re-install to upgrade to 1.3.8 database query
    By rubear in forum Upgrading from 1.3.x to 1.3.9
    Replies: 12
    Last Post: 18 Mar 2008, 05:40 AM

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