Bug delete with table alias
Bug delete with table alias
belu
Posts: 38Questions: 14Answers: 0
in Bug reports
Hi,
I think I found a bug:
If you use a table on instancing editor alias like this:
$editor = Editor::inst( $db, 'guestlist_disabled_dates as guestlist', 'id' );
deleting a row with buttons is not possible due to an sql-statement error:
"DELETE FROM guestlist_disabled_dates as guestlist WHERE (guestlist_disabled_dates
.id
= :where_1 )"
This throws an SQL error.
thanks,
Bernhard
This discussion has been closed.
Replies
Telling us what the error actually says would have been sensible.
You have aliased your table so use the alias in your WHERE clause.
The SQL query is generated by editor and not by myself...
here the error:
An SQL error occurred: SQLSTATE[42000]: Syntax error or access violation: 1064 You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'as guestlist WHERE (
guestlist
.id
= '29' )' at line 1Can you post the Editor code please? I'm not clear why a row with Buttons is different to any other row.
Colin