Skip to Content Skip to Menu

Dynamic WHERE statement in MySQL Field

  • dmpneuro
  • dmpneuro
  • OFFLINE
  • Posts: 14
  • Thanks: 0
  • Karma: 0
12 years 2 months ago #208253 by dmpneuro
Dynamic WHERE statement in MySQL Field was created by dmpneuro
Is it possible to have a WHERE statement in a MySQL field that can change based on the current profile and pull the filter from that profile? It might look something like this:

WHERE: cb_address=[cb_address]

or

WHERE: cb_address LIKE [cb:userdata field="cb_address" user="#displayed" /]

and the right hand side of the comparison statement will be evaluated first to generate the data to be used in the sql where statement.

Essentially, I want to query the database for records that match a field within the currently displayed profile (not the user). I can't seem to do it with User lists, and I thought this might work. Other than {USERID} and {VIEWERID}, the WHERE statement only seems to accept fixed (constant) data for the WHERE statement comparison, not a CB field name.

Thanks.

Please Log in or Create an account to join the conversation.

Moderators: beatnantkrileon
Powered by Kunena Forum