Re: "Select" & "Order By" OK- ''WHERE'' Does'nt Work !
From: Tom Thackrey (use.signature_at_nospam.com)
Date: 10/31/03
- Next message: Matthias Esken: "Re: "Select" & "Order By" OK- ''WHERE'' Does'nt Work !"
- Previous message: simonc: "Code that never exits?"
- Next in thread: Matthias Esken: "Re: "Select" & "Order By" OK- ''WHERE'' Does'nt Work !"
- Maybe reply: Matthias Esken: "Re: "Select" & "Order By" OK- ''WHERE'' Does'nt Work !"
- Reply: Sh0t: "Re: "Select" & "Order By" OK- ''WHERE'' Does'nt Work !"
- Reply: ian justice: "Re: "Select" & "Order By" OK- ''WHERE'' Does'nt Work !"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: Fri, 31 Oct 2003 22:17:59 GMT
On 31-Oct-2003, i.justice@onmail.co.uk (ian justice) wrote:
> Before i post actual code, as i need a speedyish reply.
> Can i first ask if anyone knows off the top of their head, if there is
> a likely obvious cause to the following problem.
> For the moment i've reduced my form request to a simple text string
> entry, instead of my desired optional parameters. As i have been stuck
> with a single unfathomable glitch for over a year.
> Basically, if i enter queries such as ;
> "select * from table" "select * from table order by artist",
> it works perfectly. However if i introduce the 'where' option, as in
> "select * from table where artist like whatever". It comes back with
> "could not execute query". This happens even if i append "order by" to
> it.
> I'll post all the various codes if anyone can please help.
I teach students how to program. Almost every student is convinced, at one
time or another, that they have found a bug in the compiler, operating
system or hardware. In every case it's a problem with the student's code.
You are suggesting that somehow the SQL select where order by is broken for
some unspecified database system. The odds are about the same as my winning
the lottery without buying a ticket.
assuming the table and columns are correctly defined and the connection is
open and the database is selected and I haven't made a typo, the following
will work
"select * from sometable where somecolumn like 'somevalue%' order by
somecolumn"
If you want to help yourself
1) echo the actual SQL statement
2) add error capture code (e.g. 'or die(mysql_error())') to your connect,
dbselect and query calls
If you want more help here
1) show us the actual code including the echoed sql statement and error
message if any
2) show us the table definition
3) tell us which database you are using and what version
4) tell us the version of PHP and if it's in safe mode
-- Tom Thackrey www.creative-light.com tom (at) creative (dash) light (dot) com do NOT send email to jamesbutler@willglen.net (it's reserved for spammers)
- Next message: Matthias Esken: "Re: "Select" & "Order By" OK- ''WHERE'' Does'nt Work !"
- Previous message: simonc: "Code that never exits?"
- Next in thread: Matthias Esken: "Re: "Select" & "Order By" OK- ''WHERE'' Does'nt Work !"
- Maybe reply: Matthias Esken: "Re: "Select" & "Order By" OK- ''WHERE'' Does'nt Work !"
- Reply: Sh0t: "Re: "Select" & "Order By" OK- ''WHERE'' Does'nt Work !"
- Reply: ian justice: "Re: "Select" & "Order By" OK- ''WHERE'' Does'nt Work !"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|