----- Original Message ----- 
From: "lavanya lavi" <[EMAIL PROTECTED]>
To: <[email protected]>
Sent: Wednesday, March 28, 2007 2:46 PM
Subject: Re: [php-list] can any body help me


Hello Eeveryone,
I think when we get select query in a variable that time we fetched the
query to one variable. Like....
  $sel="select * from table where Emp_id ='$_POST[id]';
  $rec=mysql_query($sel);
  while($res=mysql_fetch_array($rec)){

  $Emp_id =$res['Emp_id'];
  //Now we are using like this ...

  if($Emp_id ==67)
  {
  $Emp_id =55;
  }
  else
  {
   $Emp_id =$Emp_id ;
  }
  }

  Plz let me know this is correct or not...

  Thanks,
  Lavanya.

anuksimon <[EMAIL PROTECTED]> wrote:
          hi all,
can i write a query like in mysql using select query

if(Emp_id = 67)

Emp_Id = 55;

else

Emp_Id = Emp_Id
-----------------------------------
  $sel="select * from table where Emp_id ='$_POST[id]';
Should be -
  $sel="select * from table where Emp_id =" . $_POST[id] ;

Reply via email to