Please Help in this Query

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
shafiq2626
Forum Commoner
Posts: 88
Joined: Wed Mar 04, 2009 1:54 am
Location: Lahore
Contact:

Please Help in this Query

Post by shafiq2626 »

Hi everyone
i worte this query

Code: Select all

select c.cid,c.year,c.grade,c.cpic,c.color,c.instock,m.mname,md.mdname,f.fname,t.tname from tbl_car c,maker m,model md,ftype f,transmission t,tbl_orders Ord where c.mid=m.mid AND c.mdid=md.mdid AND c.fid = f.fid AND c.tid = t.tid AND c.cid =Ord.cid AND Ord.u_id=1 AND Ord.status=Inprocess order by orderdate

but this give an error that
Unknown column 'Inprocess' in 'where clause'

why this give error of column Inprocess while Inprocess is a value of status
Actualy i want to retrieve records where status will be Inprocess.

Real Query is this

Code: Select all

$sqlQuery="select c.cid,c.year,c.grade,c.cpic,c.color,c.instock,m.mname,md.mdname,f.fname,t.tname,Ord.status from tbl_car c,maker m,model md,ftype f,transmission t,tbl_orders Ord where c.mid=m.mid AND c.mdid=md.mdid  AND c.fid = f.fid AND c.tid = t.tid AND c.cid =Ord.cid  AND Ord.u_id=$_SESSION[uid] AND Ord.status=$_GET[status] order by orderdate";
Please help
User avatar
VladSun
DevNet Master
Posts: 4313
Joined: Wed Jun 27, 2007 9:44 am
Location: Sofia, Bulgaria

Re: Please Help in this Query

Post by VladSun »

You need a string value there, not a column name:

[sql]AND Ord.STATUS='Inprocess'[/sql]
There are 10 types of people in this world, those who understand binary and those who don't
Post Reply