Bryan wrote:
SELECT * FROM productgroup WHERE groupid = $productid
AND label = 'Cats' ORDER BY title
SELECT * FROM productgroup WHERE groupid = $productid
AND label != 'Cats' ORDER BY label,title
I'd like to find a way to combine these 2 statements. I want to list out
all the products,
Try this:
SELECT * FROM productgroup WHERE groupid = $productid
ORDER BY label = 'Cats' DESC, title
The test SQL I did to make sure I understood it was this (against our Users
table):
select * from users order by first = 'Bob' DESC, first, last
It put all the Bobs first, sorting them by
I think there's one small piece of data I left out. I'm working with
php/mssql, no mysql. I'll move to mysql when I get everything else
built. Mssql 2000 doesn't seem to like the = sign in the order by
clause. It looks like both of you so far have come up with the same
syntax though so it must
I think there's one small piece of data I left out. I'm working with
php/mssql, not mysql. I'll move to mysql when I get everything else
built. Mssql 2000 doesn't seem to like the = sign in the order by
clause. It looks like both of you so far have come up with the same
syntax though so it
PHPDiscuss - PHP Newsgroups and mailing lists wrote:
Hello everybody,
I'm building a small application and I have trouble passing a POST
variable form one page to another inside the SQL statement.
The query displayed below works great without the
.$_POST['CompanyName'].
$query_company_listing =
: [EMAIL PROTECTED] (PHPDiscuss - PHP Newsgroups and mailing
lists)
To: php-db@lists.php.net
Subject: [PHP-DB] SQL statement syntaxis
Date: 6 Jan 2005 19:12:16 -
Hello everybody,
I'm building a small application and I have trouble passing a POST
variable form one page to another inside the SQL
Jason,
can you please turn off the return receipts on emails you send to the list.
it's bloody annoying to have 'The Sender wishes to be notified'
popup messages everytime I read one of your emails (and, alas, I don't
have the skill to hack the return receipt crap right out of Tbird). BTW
Hi,
To stop the return receipt dialog appearing in Tbird...
Tools... Options... Advanced... Return Receipt and select Never send a
return receipt. Or you can choose some of the other selections.
graeme
Jochem Maas wrote:
Jason,
can you please turn off the return receipts on emails you send to
Hello everybody,
I'm building a small application and I have trouble passing a POST
variable form one page to another inside the SQL statement.
The query (displayed below) works great without the
.$_POST['CompanyName'].
$query_company_listing = SELECT CompanyID, CompanyName,
Hello everybody,
I'm building a small application and I have trouble passing a POST
variable form one page to another inside the SQL statement.
The query (displayed below) works great without the
.$_POST['CompanyName'].
$query_company_listing = SELECT CompanyID, CompanyName,
Hello everybody,
I'm building a small application and I have trouble passing a POST
variable form one page to another inside the SQL statement.
The query displayed below works great without the
.$_POST['CompanyName'].
$query_company_listing = SELECT CompanyID, CompanyName,
CompanyOrDepartment,
@lists.php.net
Subject: [PHP-DB] SQL statement
Hello everybody,
I'm building a small application and I have trouble passing a POST
variable form one page to another inside the SQL statement.
The query displayed below works great without the
.$_POST['CompanyName'].
$query_company_listing = SELECT
For some background, I've been tasked with building a marketing tracking application
by the PHB's who think that being able to write SQL means you can code. I know how to
get data into a database and I can do thing with it once it's in there, but this is
one of my first attempts at extracting
Jimi,
PHP does not return an error because it knows nothing about valid sql.
It's just knows if it's a valid PHP statement. (which it is because
you've got the 's in the right place and a ; at the end. ) :)
It's up to MySQL to return an error.
As to your statement.
1: It's easier and valid in
Thompson, Jimi wrote:
So then I try do this
?php
if ($fk_phone != NULL) {
$sqlwrk = SELECT `pk_phone_reports`, SUM(`calls`) AS `total_calls`,
`date`, `calls` , `fk_ph_num` FROM `phone_reports`;
$sqlwrk .= WHERE `pk_phone_number` = . $fk_phone;
$rswrk =
Hi All
I am trying to load a mysql statement which i have tested and know to work
from a var in my script.
It is a create table statement.
I have a good connection as a table list shows tables.
I tried to echo my var but no joy
Any ideas?
Thanks in Advance
Dave C
--
PHP
]]
Sent: Monday, March 18, 2002 9:22 PM
To: [EMAIL PROTECTED]
Subject: [PHP-DB] SQL statement - PHP/mySQL - brain fart
For some reason I keep thinking that this should be simple - but I just
can't seem to figure it out. Help??? Please??? [I've been working on
it for two days now.]
Overview
For some reason I keep thinking that this should be simple - but I just
can't seem to figure it out. Help??? Please??? [I've been working on
it for two days now.]
Overview: What I'm trying to do is query one table by passing it two
different variables - and return only the results that are
On Tuesday 19 March 2002 10:22, Summit wrote:
For some reason I keep thinking that this should be simple - but I just
can't seem to figure it out. Help??? Please??? [I've been working on
it for two days now.]
Overview: What I'm trying to do is query one table by passing it two
different
* from tmp1, tmp2 where tmp1.si=tmp2.si;
Does this work for you??
Gurhan
-Original Message-
From: Summit [mailto:[EMAIL PROTECTED]]
Sent: Monday, March 18, 2002 9:22 PM
To: [EMAIL PROTECTED]
Subject: [PHP-DB] SQL statement - PHP/mySQL - brain fart
For some reason I keep thinking
Well it's sorta' simple once you get your mind around this - you need two
tables but you've only got one. And there's no OR, you need both to be true
for a site_id ...
The query would be easy if you actually had two tables so we'll search off
of the same table twice giving it different names
Hi!
I am looking for a SQL Statement that would allow me to remove a column
from the table in the database. Just give me what you know and I'll check
out the SQL Reference I have for the database. Don't worry about what type
of database do I have, that's what hte SQL Reference is for. (It
scott,
try " alter table drop(column)"
-u
-Ursprngliche Nachricht-
Von: Scott Fletcher [mailto:[EMAIL PROTECTED]]
Gesendet: Mittwoch, 28. Februar 2001 14:50
An: [EMAIL PROTECTED]
Betreff: [PHP-DB] SQL STATEMENT?
Hi!
I am looking for a SQL Statement that woul
PROTECTED]]
Sent: Wednesday, February 28, 2001 7:50 AM
To: [EMAIL PROTECTED]
Subject: [PHP-DB] SQL STATEMENT?
Hi!
I am looking for a SQL Statement that would allow me to remove a
column
from the table in the database. Just give me what you know and I'll check
out the SQL
24 matches
Mail list logo