[PHP] NewB Q on Arrays.

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



[PHP] NewB PHP / mysql Q

2002-10-10 Thread inpho

Hi all,

I need a bit of quick help here
I've joined 2 tables together with this code here:

$result=mysql_query(select u.id, u.cid, u.lname, u.fname, u.vld, c.id,
c.cname from tblclient u, tblcompany c where u.vld=1 and u.cid = c.id,$db);

then I put it into an array:

while ($row=mysql_fetch_array($result)) {
print trtd$row[UName]/tdtd$row[FName]
$row[LName]/td$row[cname]td/td/tr;
}

but the $row[xxx] aren't displaying any info, if I put $row[u.unam] it
returns an error. I run the SQL query in phpmyadmin and it runs fine,
returning 2 results
how do I access those results through an array???

- inpho -





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