I have a situation in my MySQL database table row repeating So I got this
DELETE from table1 USING table1, table1 as vtable WHERE (NOT table1.ID=vtable.ID) AND (table1.field_name=vtable.field_name)
Where table1 is the table and vtable is the virtual table
table1
vtable
How do I write that in the Zend Framework
Zend_Db_Select supports the USING , but I think that it is not supported by the Zend_Db_Adapter delete() method.
Zend_Db_Select
USING
Zend_Db_Adapter
delete()
A possible alternative would be to pass the SQL expression directly to the connection (if you use the pdo_mysql adapter, this will be a PDO object ):
pdo_mysql
$ db-> GetConnection () β Exec ($ sqlExpression);
( IMPORTANT : make sure that you correctly specify all identifiers and values ββin the SQL statement, Zend_Db_Adapter has extensive documentation about this).
I'm not sure what you are trying to do, but here is how to use basic delete in Zend:
$db->delete('table1', array('ID != ?' => $otherID, 'field_name = ?' => $otherFieldName));
Is this what you are looking for?
Source: https://habr.com/ru/post/1383833/More articles:Convert perl script to vba - vbaUsing custom property in Google App Engine - pythonChanging the properties of a wireless network adapter wireless network - c #Remove row from Zend_Db_Table with JOIN - phpAnimated loader - androidWork with Gif Image - androidPlay framework - user authentication - playframeworkSlow performance should shrink faster, what is this error about? - couchdbreplacement for luaL_getMetaTable - luaSetting up continuous integration with Rails - ruby-on-railsAll Articles