What is the normal sql delete query that you used? Does $dateval need to be quoted?
Mark On Mon, Jun 15, 2009 at 8:00 AM, salmarayan<[email protected]> wrote: > > I want to delete a row from the database, when a certain condition occurs > so I made a query > $db= Zend_Registry::get('db'); > $sql="SELECT Date_of_Changing FROM old_passwords874 WHERE username = '$user' > ORDER BY Date_of_Changing ASC LIMIT 1"; > $result=$db->fetchCol($sql); > $dateval=$result[0]; > $n= $db->delete('old_passwords874','Date_of_Changing ='.$dateval); > > The Select query gets the results, but the delete doesnt work there is an > error with the where condition of the delete query. > i tried the nomral sql delete query > $sql="DELETE FROM 'old_passwords874' WHERE username='$user' ORDER BY > Date_of_Changing ASC LIMIT 1"; > > But it doesnt not work with Zend, Please Help.. Thanks in advance. > -- > View this message in context: > http://www.nabble.com/Delete-Query-doesnt-work-with-Zend-tp24035172p24035172.html > Sent from the Zend Framework mailing list archive at Nabble.com. > > -- Have fun or die trying - but try not to actually die.
