2

I have a HTML table where a user can subscribe.I send an ajax call when the user clicks the subscribe button and store it in a non ee table.Next time when the user comes on the same page,I want to show "you have subscribed instead of subscribe".PHP stage is input.

Because of some reasons,i cant store my data in exp_members_data.Since i am using a non ee table,

How can i query it to get the desired result.

Any solution? This is what I am doing.

{exp:query sql="SELECT screen_name, email, location FROM My_table WHERE user = 'subscribed'"}
        {screen_name}
        {email}
        {location}
{/exp:query}

1 Answer 1

1

What you have will work fine. You can query any table in the database with the query module. You may, though, have issues with table prefixing. I'm not sure if the query module auto-prefixes tables or not, but in the past I've had issues with tables not named with exp_, as EE tends to automatically add the prefix to queries.

2
  • so i will get the data with {screen_name},{email},{location}?
    – user2133
    Feb 13, 2014 at 13:42
  • Whatever fields you select are what get parsed as variables inside the tag pair. Feb 13, 2014 at 14:49

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy