foto1
Make it simple to transparently display data on a website. Tools JX is a set of database reporting tools for Joomla! All of them are made to be very intuitive and as simple to use as possible.
foto1
Paid Downloads is a solution for you! It is a lightweight and simple-to-use extension, that makes your e-commerce simple and manageable. It uses PayPal's service to execute transactions.


Tools JX

Joomla plugins


Welcome, Guest
Username: Password: Remember me
This is the optional Forum header for the Suggestion Box.

TOPIC: WHERE clause

WHERE clause 4 years 2 weeks ago #1043

  • daalouw
  • daalouw's Avatar
  • OFFLINE
  • Fresh Boarder
  • Posts: 1
  • Karma: 0
Hello.

Before I purchase this software, I want to ensure that it can perform a WHERE clause based on the current user's userid that is logged in.

I have a table that contains several rows for each of my users. Key to the table is "date" and "userid". So, I want to pull back the most current row of data for my user.

Can this software do that?

Regards
daalouw
The administrator has disabled public write access.

Re:WHERE clause 4 years 2 weeks ago #1044

  • viljem
  • viljem's Avatar
  • OFFLINE
  • Administrator
  • Posts: 178
  • Karma: 0
Hi,

yes, you can do this with Table JX.

If you didn't have date it would be more easier, you would just write in admin area in where section (article that contains this grid is in registered area)
WHERE id=@user_id

You can also write something like this:
WHERE id=@user_id AND latest=True
(if you have column latest that describes the latest row for each user)

But if you don't have the latest column you can create sql view that filters only latest row for each user:

Something like this:

CREATE VIEW myLatestDataForEachUser AS
SELECT id, max(dateColumn)
FROM myTable
GROUP BY id


You display then this view with Table JX and write in WHERE section of admin area:
WHERE id=@user_id

Best regards,
Viljem
The administrator has disabled public write access.
Moderators: tomaz
Time to create page: 0.156 seconds