Re: [PHP] NewB Q on Arrays.

2003-03-25 Thread Frappy John
> 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



Re: [PHP] [MySQL] Code Help Please

2003-06-01 Thread Frappy John
Monfort--

>   There lies my problem.
>   How do I get mysql to translate:
>... where table.username =
> 'table2.domain/table2.username' into

See:

http://lists.mysql.com/mysql?sub=1

--Frappy

On Friday 30 May 2003 08:35 pm, [-^-!-%- wrote:
> Hello all !
>
> Need a little help here. Is there a way to "translate"
> variables/field names in an SQL statement?
>
> I need to compare the "content" of two database fields
> that are in different tables. The trick, though, is that
> I need to join two fields together (as a string) before I
> compare it.
>
> For example:
>
> Table 1 has a field named username, with the following
> values:
>
>   id | username | first_name | last_name
>   1  | prgn/jason   | jason  | x
>   2  | falcon/paul  | pual   | wood
>
>   *The username in table is composed of the user's domain
> name and login name. Those fields are separated in table
> 2. Like
>
> Table 2
>   id | username | domain | first_name | last_name
>   1  | paul | falcon | paul   | wood
>   2  | jason| prgn   | jason  | x
>
>
>   * the data is rearranged, but it's the same.
>
>
>   Now, I need to compare the values from table 2 to table
> 1. That is, I need to find if table1.username =
> table2.domain/table2.username  is true.
>
>   There lies my problem.
>   How do I get mysql to translate:
>... where table.username =
> 'table2.domain/table2.username' into
>...where  'prgn/jason' = 'prgn/jason'
>and not into
>...where 'prgn/jason' = 'prgn' / 'jason'//
> division.
>
>   That is, I need it to compare 'prgn/jason' (from
> table1.username) to the string representation, of the
> values of table2.domain/table2.username (i.e. prgn/jason)
> and not read it as 'table2.prgn' divided by
> 'table2.username' ?
>
>
>
>
>  I have the following code:
>
> " select * from table1 t1, table 2 t2 where t1.username =
> 't2.domain/t2.username' "
>
>
> ** how do I concatenate the two values, to compare it to
> that of table 1. i.e.  prgn/jason = prgn/jason   and not
> 'prgn/jason' = 'prgn' divided by 'jason'?
>
>
> Please help.
>
> -john

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] FTP DLL

2003-06-01 Thread Frappy John
On Saturday 31 May 2003 07:41 am, Canadaka wrote:
> Me and a friend have been trying to make a php ftp
> client, 

I'm confused. Do you literally mean an FTP client that is 
written in PHP (thus requiring PHP to be installed on each 
client machine)?

Or do you mean a PHP generated HTML-based page, delivered 
to the client's browser, that interfaces with an FTP server?

Or maybe you mean a PHP page, delivered to the client's 
browser, that triggers FTP transactions between your PHP 
server and a remote FTP server and then passes the result 
on to the client. (That would be termed a proxy, I presume.)

--Frappy

> it works fine on *nix systems, but not on
> Windows. We looked at everything, until i finaly noticed
> that php 4.2.3 is missing in the php.ini the
> extension=php_ftp.dll line. The actualy file in the
> extensions dir is missing as well.
>
> So where did it go? and where can i get it? can anyone
> send it too me? I was unable to find one on google. Or is
> there a reason its gone?
>
> Thanks

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php