|
|||
|
Hi,
I've got a script which edits and deletes data in database. To select row for edit/del, I want to use $id variable. To perform a sql qeury "SELECT" I use following code PHP Code:
Code:
DELETE FROM table WHERE id = $id Regards, Tru |
|
|||
|
The delete and update functions both take a standard where clause as the final argument, but don't do variable insertion. The adapter has a separate quoteInto() function that can handle that though.
Your example delete would look like Code:
$adapter->delete('table', $adapter->quoteInto('id = ?', $id));
|
![]() |
| Thread Tools | |
| Display Modes | |
|
|