WordPress.org

Ready to get started?Download WordPress

Forums

ABASE
Fatal Error (1384) - with sql="" (1 post)

  1. w14r
    Member
    Posted 7 months ago #

    For a user list based on users and usermeta I prepared the sql SELLECT code for MySQL and tested it successfully directly in the MySQL database.

    SELECT
        m1.meta_value AS last_name,
        m2.meta_value AS first_name,
        m3.meta_value AS addr1,
        m4.meta_value AS zip,
        m5.meta_value AS city,
        m6.meta_value AS phone1,
        u1.user_email
    FROM bvjet_users u1
    JOIN bvjet_usermeta m1 ON (m1.user_id = u1.id AND m1.meta_key = 'last_name')
    JOIN bvjet_usermeta m2 ON (m2.user_id = u1.id AND m2.meta_key = 'first_name')
    JOIN bvjet_usermeta m3 ON (m3.user_id = u1.id AND m3.meta_key = 'addr1')
    JOIN bvjet_usermeta m4 ON (m4.user_id = u1.id AND m4.meta_key = 'zip')
    JOIN bvjet_usermeta m5 ON (m5.user_id = u1.id AND m5.meta_key = 'city')
    JOIN bvjet_usermeta m6 ON (m6.user_id = u1.id AND m6.meta_key = 'phone1')
    ORDER BY m1.meta_value ASC
    LIMIT 100

    This code is very fine user readable. But used inside [abase sql=""] it caused the Fatal Error (1384). I needed to use the sql code in one long line to get the ABASE pluging running without error.

    The same code in one line:

    [abase sql="SELECT m1.meta_value AS last_name, m2.meta_value AS first_name, m3.meta_value AS addr1, m4.meta_value AS zip, m5.meta_value AS city, m6.meta_value AS phone1, u1.user_email FROM bvjet_users u1 JOIN bvjet_usermeta m1 ON (m1.user_id = u1.id AND m1.meta_key = 'last_name') JOIN bvjet_usermeta m2 ON (m2.user_id = u1.id AND m2.meta_key = 'first_name') JOIN bvjet_usermeta m3 ON (m3.user_id = u1.id AND m3.meta_key = 'addr1') JOIN bvjet_usermeta m4 ON (m4.user_id = u1.id AND m4.meta_key = 'zip') JOIN bvjet_usermeta m5 ON (m5.user_id = u1.id AND m5.meta_key = 'city') JOIN bvjet_usermeta m6 ON (m6.user_id = u1.id AND m6.meta_key = 'phone1') ORDER BY m1.meta_value ASC "]

    What need to be done to have a redable sql request inside [abase sql=""]?

    https://wordpress.org/plugins/abase/

Reply

You must log in to post.

About this Plugin

About this Topic