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
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_
2, 2002 10:16 AM
To: Php-Db (E-mail)
Subject: [PHP-DB] sql select
if i have a statement
$result = mysql_query("SELECT
labor_id,labor_ord_no,labor_wkyr,works_orders_part_no,works_orders_qty,works
_orders_customer_id,labor_qty,labor_time,labor_qty*parts_time+parts_setup AS
timea FROM labor,
if i have a statement
$result = mysql_query("SELECT
labor_id,labor_ord_no,labor_wkyr,works_orders_part_no,works_orders_qty,works
_orders_customer_id,labor_qty,labor_time,labor_qty*parts_time+parts_setup AS
timea FROM labor,works_orders,parts WHERE labor_ord_no=works_orders_ord_no
AND works_orders
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
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
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
Hello all
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
thankyou
Grant
--
PHP Database Mailing List (http://www.php.net/)
> 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
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
>think you can give your problem another approach, splitting it in two
>queries and joining the result sets through php script.
>Sometimes you can't put SQL to do all the work.
That's true, but in most cases it is more efficient to leave the joins,
orders etc. in the DB, because its more optimze
PROTECTED]>
Enviada em: sexta-feira, 16 de fevereiro de 2001 22:44
Assunto: [PHP-DB] SQL Select statement
> I have a table with three simple columns: id(unique), memberID, and
> choice
>
>
> I want to find out which memberIDs have BOTH choice 2 AND choice 3.
>
> --> SELECT me
dexes and the
amount. the second sql asumes you only have one row per memberID - choice
(noone should choose 3 2times ore more)
mk
-Ursprungliche Nachricht-
Von: bill [mailto:[EMAIL PROTECTED]]
Gesendet: Samstag, 17. Februar 2001 02:45
An: [EMAIL PROTECTED]
Betreff: [PHP-DB] SQL S
I have a table with three simple columns: id(unique), memberID, and
choice
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 ex
14 matches
Mail list logo