> What i want to be able to do is determine if a certain
> user has watched a movie.
If you want to check the log to see if a single user has
viewed a particular movie, then include the user and movie
in the select statement:
select uid, mvid from mvlogtbl where uid = $userID and mvid
= $movieID
If mysql_num_rows > zero, then user has watched this movie.
Better still:
select count(uid) from mvlogtbl where uid = $userID and
mvid = $movieID
Here one row will be returned containing the number of
times the user has viewed the movie.
--Frappy
On Tuesday 25 March 2003 06:18 am, inpho wrote:
> Hey All,
>
> I'm still a newB in php and mysql so I'm asking for your
> patience up front.
>
> i want to get a list of results from an array, which I
> can do with:
>
> $result=mysql_query("select * from mvlogtbl",$db);
> while ($row=mysql_fetch_array($result)){
> echo "$row[uid] $row[mvid]";
> }
>
> basically what I have is a database of movies linked to
> .avi files that are setup for streaming, the table
> mvlogtbl keeps a log of who has watched what.
>
> What i want to be able to do is determine if a certain
> user has watched a movie. But there are multiple entries
> for each user, a user may have watched the movie more
> than once, I don't really care, I just want to be able to
> tell if they have watched it or not...
>
> any help?
>
> Thanls
>
> - paul -
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php