How to delete a row in a MySQL database?

how can we delete from a table sql Please, I trying this code but when i execute it i have the error “bad request”

Hi @salma_fahmi00 welcome to Kodular Community
You have to use column name between ‘select’ and ‘from’ to delete a row.

2 Likes

Thank you for your answer . But i want to delete all the row . will i use all column . for example DELETE Id_Event, Name,Date WHERE ID_Event=‘2’?
Thank you it is so kind vknow360

I found an error in ‘Run Query’ procedure blocks.
I think it should be like this:

And the query should be like this:
DELETE FROM 'table_name' WHEREid= 18;

thank you, but i used the same query bloc and it works to create , display and insert data . the problem is just at the delete request . I can’t resolve it until now :frowning:

Can you send a sample apk?
Or paste/show here full error.

there is a form in my application that need sign up and the app contains a lot of sections. i join the screensht of the error.

Try using blocks shown in the image above

I used a colin tree listView where i display all the sql table . and next every row of the list i put a button to delete the row corresponding

thank you for using the MySQL interface

what about trying a correct delete statement?
Unbenannt
as it already has been suggested…

Taifun

thank you for the answer . i already tried it but it’s not working also

It would really help if you provided a screenshot of the updated relevant blocks, so we can see what you are trying to do, and where the problem may be.

also use Do it to debug your blocks, see tip 4 here App Inventor: How to Learn | Pura Vida Apps

Taifun

1 Like

(post withdrawn by author, will be automatically deleted in 24 hours unless flagged)

remove the single quotes, a correct delete statement is
DELETE FROM Evenement WHERE id_Event = 21
assuming, the table name is Evenement and there is a column id_Event available, note: table names and column names are case sensitive
see also SQL DELETE Statement
how does your Web.GotText event look like?

btw. why are you now posting using a sock puppet account?
also posting your email address in a public forum probably is not a good idea… do you want to attract loads of spam to your account?

Taifun

okkey thank you a lot for everyone i resolve the error.