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
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,works_orders,parts WHERE
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
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 won't
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
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/)
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
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 parse
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 tables
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 optimzed
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 table as t1,
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
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 Select
13 matches
Mail list logo