I don't think you can reference the aliased column timea in the select
clause, I know sql server won't let you do it..try and
(labor_qty*parts_time+parts_setup)>labor_time
-Original Message-
From: Steve Dodkins [mailto:Steve.Dodkins@;ebm-ziehl.co.uk]
Sent: Tuesday, November 12, 2002 10:16
Have you ran it by hand in MySQL from the command prompt with some test
data and gotten an error?
Adam
On Tue, 12 Nov 2002, Steve Dodkins wrote:
> if i have a statement
>
> $result = mysql_query("SELECT
> labor_id,labor_ord_no,labor_wkyr,works_orders_part_no,works_orders_
Top man!!
Many thanks
Steve
-Original Message-
From: [EMAIL PROTECTED] [mailto:epeloke@;echoman.com]
Sent: 12 November 2002 16:02
To: Php-Db (E-mail)
Subject: RE: [PHP-DB] sql select
I don't think you can reference the aliased column timea in the select
clause, I know sql server
Grant,
$link_id = mysql_connect($host, $usr, $pass) or die (mysql_error());
mysql_select_db($database, $link_id);
$sql="select fields from $table where criteria = $value";
$result = mysql_query($sql, $link_id) or die ("no results"); //return result
set to php
you still need to do something wit
In article <99jh2n$gr1$[EMAIL PROTECTED]>,
[EMAIL PROTECTED] ("Grant") wrote:
> Is there any way of using a string in an SQL query instead of using the
> table name. Something along the lines of
>
> $result=mysql_query("SELECT * FROM $tablename",$db);
>
> this doesnt work it come up with a par
On Sat, Mar 24, 2001 at 08:55:13PM -, Grant wrote:
> Is there any way of using a string in an SQL query instead of using the
> table name. Something along the lines of
>
> $result=mysql_query("SELECT * FROM $tablename",$db);
>
> this doesnt work it come up with a parse error
Your problem is
Try this way :
"select t1.memberID,t1.choice,t2.memberID, t2.choice from table as t1, table
as t2 where t1.choice = 2 and t2.choice =3"
It works, but you'll going to have as many records as the bigger number of
records between choice=2 and choice = 3, no matter you use the distinct
keyword or n
Addressed to: "JJeffman" <[EMAIL PROTECTED]>
"PHPDB" <[EMAIL PROTECTED]>
"bill" <[EMAIL PROTECTED]>
** Reply to note from "JJeffman" <[EMAIL PROTECTED]> Sat, 17 Feb 2001 13:11:20
-0300
>
> Try this way :
>
> "select t1.memberID,t1.choice,t2.memberID, t2.choice from ta
> I want to find out which memberIDs have BOTH choice 2 AND choice 3.
>
> --> SELECT memberID from table where choice=2 AND choice = 3
>
> That won't work (0 results, of course, because no row has two choices,
> they're mutually exclusive)
>
Exactly, keep several rows for choices,
have two tabl