Can you tell me what this query says/does?

Can you tell me what this query says/does? In particular regarding ‘id_user’, please?

$get_videos = $db->rawQuery("SELECT DISTINCT(v.id), v.*, upv.earned_amount as earned_amount, upv.time_date as time_date FROM u_paid_videos AS upv LEFT JOIN " . T_VIDEOS . " AS v ON (upv.id_video = v.id) WHERE upv.id_user = {$user->id} AND upv.time_date ORDER BY upv.id DESC");

I look forward to any assistance

You might be better asking the in the database section of the forum, as there isn’t really any PHP content in the question. I mean, it’s called from PHP of course, but you’re asking about the query, not the way you execute it.

As you have this in working, running code, can’t you look at the results and get an idea of what it does from the results it brings?

That part seems fairly self explanatory.

It’s only picking rows where the id_user column value matches the id property of the $user object.

Thanks for your replies. Yes, I was thinking it should be in the database section.
However, the reason I ask is what this query does/says is because that (from the other posting) the PAYER NAME is not displaying (the information stored in the ‘u_paid_videos’ db table) from the ‘id_user’ column, as I’d like. It is showing a user id from somewhere else.

Any ideas, suggestions is appreciated.

This topic was automatically closed 91 days after the last reply. New replies are no longer allowed.