RE: [PHP] help with query

2012-06-07 Thread Jack Sasportas
Thanks Jim, worked like a charm. > -Original Message- > From: Jim Lucas [mailto:li...@cmsws.com] > Sent: Thursday, June 07, 2012 4:08 PM > To: Jack > Cc: PHP > Subject: Re: [PHP] help with query > > On 06/07/2012 09:37 AM, Jack wrote: > > $query = "sele

Re: [PHP] help with query

2012-06-07 Thread Jim Lucas
On 06/07/2012 09:37 AM, Jack wrote: $query = "select a.startdate, a.articleid, c.name, a.title, a.intro, a.datecreated from articles as a, categories as c where (a.startdate = -1 or a.startdate<= {$now}) and (a.enddate = -1 or a.enddate>= {$now}) and a.categoryid = c.categoryid order by a.startda

Re: [PHP] help with query

2012-06-07 Thread Ashley Sheridan
Jack wrote: >Hello All, > > > >I have this string defined for my query and it shows the different >types of >categories fine, but when I change a.categoryid = c.categoryid to >a.categoryid = 1 which is only one of the categories > >It shows me the same record twice. > > > >$query = "select a.st

Re: [PHP] Help with query

2002-02-09 Thread val petruchek
> Hi, > > i can?t seem to get my head to wake up... > > How would i do to count how many different values that exists in a mysql > field? Ie i have a date-field and need to know how many different dates that > exists in the table. select count(distinct name) from site; in Mysql Valentin Petruche

Re: [PHP] Help with query

2002-02-09 Thread Bas Jobsen
$number=mysql_num_rows(mysql_query("SELECT DISTINCT date FROM $table")); Op zaterdag 09 februari 2002 13:41, schreef Daniel Alsén: > Hi, > > i can´t seem to get my head to wake up... > > How would i do to count how many different values that exists in a mysql > field? Ie i have a date-field and ne