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, ordere
How about a union?
SELECT * FROM productgroup WHERE groupid = $productid
AND label = 'Cats' ORDER BY title
UNION
SELECT * FROM productgroup WHERE groupid = $productid
AND label != 'Cats' ORDER BY label,title
Also, for long-term maintenance, it would probably be better to list the
columns rather
Yeah, that's a bit of an important piece of information. Some tricks do work
across versions of SQL, but not always.
Something else you can try is creating an artificial column to sort by. Excuse
the code, it's been ages since I've worked with MS SQL so syntax is probably
off, but just to dem
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 must
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
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 "Bob"s first, sorting them by firs
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, ordere
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, ordered by title but
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 t
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
yo
R BY
CompanyName ASC";
bastien
From: [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
var
the syntax for that looks fine to me
what you might want to try doing is something like this
if( isset( $_POST['CompanyName'] ) ) {
$query_company_listing = "SELECT CompanyID, CompanyName,
CompanyOrDepartment, BillingAddress, City, PostalCode, PhoneNumber FROM
company WHERE company.Co
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 =
mailto:[EMAIL PROTECTED]
Sent: Thursday, January 06, 2005 12:09 PM
To: php-db@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
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
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,
CompanyOrDepartme
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,
CompanyOrDepartme
Thompson, Jimi wrote:
So then I try do this â
Note that this shouldnât work since it isnât a valid SQL statement.
> I'm not sure why PHP doesn't return some kind of an error message.
PHP does return an error message, you're just not displaying it.
$rswrk = mysql_query($sqlwrk) or die(mysql_err
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
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 a
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 Data
select * 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 - brai
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 eac
elect * 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
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
> diff
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 CO
[SMTP:[EMAIL 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 giv
scott,
try " alter table drop()"
-u
-Ursprüngliche 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 would allow me t
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
29 matches
Mail list logo