[PHP-DB] query problem..

2004-07-14 Thread Micah Stevens
Hi, I'm getting an unknown colum `num` in where clause error with this query: $options = mysql_query("select options.*, count(option_items.optionID) as `num` from options left join option_li

[PHP-DB] Query Problem

2003-12-16 Thread Larry Sandwick
I need to sum the field *COST* in this query where data in *STATUS* is equal to "HELD" and "OPEN", so I will have 2 totals passed below and do not know where to begin . All information is in 1 table. Original query select distinct(Company_name), account, City, State from table where number

AW: [PHP-DB] query problem

2003-10-02 Thread Lars Jedinski
ngliche Nachricht- > Von: Doug Parker [mailto:[EMAIL PROTECTED] > Gesendet: Donnerstag, 2. Oktober 2003 20:31 > An: [EMAIL PROTECTED] > Betreff: [PHP-DB] query problem > > > I'm having a problem with a specific query. > > SELECT DISTINCT(contents_.company_id)

[PHP-DB] query problem

2003-10-02 Thread Doug Parker
I'm having a problem with a specific query. SELECT DISTINCT(contents_.company_id), companies.* FROM contents_, companies WHERE contents_.Products LIKE '%heating%' OR contents_.Manufacturer LIKE '%heating%' AND contents_.company_id = companies.id The query works fine without the "OR" segment, for

RE: [PHP-DB] Query problem

2003-07-22 Thread jeffrey_n_Dyke
<[EMAIL PROTECTED]> .net.il> cc: Subject: RE: [PHP-DB] Query problem

RE: [PHP-DB] Query problem

2003-07-22 Thread Boaz Yahav
ssage- From: Ron Allen [mailto:[EMAIL PROTECTED] Sent: Tuesday, July 22, 2003 11:29 AM To: [EMAIL PROTECTED] Subject: [PHP-DB] Query problem I have done this in the past, but for some reason it isn't working now (maybe a moron). I am trying to select all of the empty or NULL fields in

Re: [PHP-DB] Query problem

2003-07-22 Thread Ron Allen
How would the entire query look select * from ticket where Type = 'Phone' and ??? "Dirk Kredler" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > Am Dienstag, 22. Juli 2003 11:29 schrieb Ron Allen: > > This is what I have > > select * from ticket where Type = 'Line' and Closeddate

RE: [PHP-DB] Query problem

2003-07-22 Thread Peter Lovatt
select * from ticket where Type = 'Line' and (Closeddate IS NULL OR Closeddate ='') or select * from ticket where Type = 'Line' and Closeddate IS NULL HTH Peter -Original Message- From: Ron Allen [mailto:[EMAIL PROTECTED] Sent: 22 July 2003 10:29 To: [EMA

Re: [PHP-DB] Query problem

2003-07-22 Thread Dirk Kredler
Am Dienstag, 22. Juli 2003 11:29 schrieb Ron Allen: > This is what I have > select * from ticket where Type = 'Line' and Closeddate = ' empty space' > and have tried the following > select * from ticket where Type = 'Line' and Closeddate = 'Null' > select * from ticket where Type = 'Line' and Close

[PHP-DB] Query problem

2003-07-22 Thread Ron Allen
I have done this in the past, but for some reason it isn't working now (maybe a moron). I am trying to select all of the empty or NULL fields in a column. This is what I have select * from ticket where Type = 'Line' and Closeddate = ' empty space' and have tried the following select * from ticket

Re: [PHP-DB] query problem

2002-01-21 Thread Jason Wong
On Tuesday 22 January 2002 13:18, Sommai Fongnamthip wrote: > Hi, > I have problem with these mysql's query: > > select * from holder, management where holder.id=management.id or > (holder.name=management.name and holder.surname=management.surname) order > by holder.no > > It ta

[PHP-DB] query problem

2002-01-21 Thread Sommai Fongnamthip
Hi, I have problem with these mysql's query: select * from holder, management where holder.id=management.id or (holder.name=management.name and holder.surname=management.surname) order by holder.no It take a long time (more than 1 minute) with thousand record. I have

RE: [PHP-DB] Query problem cont'd..

2001-04-26 Thread Steve Brett
the query. that way you avoid an expensive if or or or or ... Steve > -Original Message- > From: Russ Michell [mailto:[EMAIL PROTECTED]] > Sent: 26 April 2001 10:50 > To: [EMAIL PROTECTED] > Subject: [PHP-DB] Query problem cont'd.. > > > Hi there: > >

[PHP-DB] Query problem cont'd..

2001-04-26 Thread Russ Michell
Hi there: I'm stil having problems with this query in that it doesn't bring up any results! Here is the menu that refreshes the page and deposites the var: 'sortedBy' into play: --select one-- Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec The SQL qery: if( ($sortedBy == 'Jan') || ($sor

Re: [PHP-DB] query problem

2001-04-25 Thread Rasmus Lerdorf
> My PHP-embedded query is as follows: > > else if($sortBy == '01') { > $sql = "SELECT * FROM $table_cal WHERE item_activity='$id' AND >DATE_FORMAT('item_date','%m') LIKE '$sortBy'"; > $sortBy = "Month of January"; > } > > * '$sortBy' is equal to '01'. > * MySQL isn't complainin

[PHP-DB] query problem

2001-04-25 Thread Russ Michell
Hi all: I'm using mysql-3.22.32: My PHP-embedded query is as follows: else if($sortBy == '01') { $sql = "SELECT * FROM $table_cal WHERE item_activity='$id' AND DATE_FORMAT('item_date','%m') LIKE '$sortBy'"; $sortBy = "Month of January"; } * '$sortBy' is equal to '01'.