Page 1 of 1

Please Help in this Query

Posted: Fri Jul 10, 2009 5:46 am
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

Re: Please Help in this Query

Posted: Fri Jul 10, 2009 6:07 am
by VladSun
You need a string value there, not a column name:

[sql]AND Ord.STATUS='Inprocess'[/sql]