On 8-Oct-2003, [email]bissatchyahoo.co.uk[/email] (mr_burns) wrote:
assuming mysql:> i am wanting to count the number of unique rows under a certain
> column. i want to count how many times a page has been accessed. how i
> plan to do this is every time a page is accessed, a session id
> variable is checked for. if noe exist, a piece of code will create on.
> then the session id is store in a table under one column and the pages
> pre-defined number will be stored under another. so if i want to check
> how many users have access a page in seperate sessions, all i need to
> do is count how many unique session ids exist for that page (using the
> page number - i.e. SELECT ... WHERE page_id = 8).
> as i mentioned, i dont know how to count how many unique entries their
> are under a column. any ideas??
$rs = mysql_query("select distinct columnname from tablename where
page_id=8") or die(mysql_error());
$num_rows = mysql_num_rows($rs);
> also, how is it i check if a variable exists??
// $variablename exists
// it doesn't
tom (at) creative (dash) light (dot) com
do NOT send email to [email]jamesbutlerwillglen.net[/email] (it's reserved for spammers)