I'm new to using MySQL queries, so please bear with me. I got an array of objects on my client side of the database connection (iPhone app) and I'm trying to implement a delete button to give the user the option to delete a certain object in the array.
I'm expecting to get an integer returned, which represents the index of the object that got deleted and now I'm creating a PHP script to take that index and use it to delete the matching row in my MySQL table.
How do I specify a specific row number to get deleted? For example, if the fourth object in my array gets deleted, I get an index of 3 returned to me. Is there any way to use this index to specify that I want the fourth row in my MySQL database deleted?
I get the whole syntax of DELETE FROM "MySQLTable" WHERE... but after the WHERE it gets kinda confusing, because it seems to me you always have to specify a condition, instead of just passing in a number of the row you want deleted. Am I wrong about this? Do rows in a MySQL table even have an index? I assume they do. Some tips on how to delete a specific row in the database by passing in a value (preferably an index) would be appreciated.
WHERE row_identfier = numbershould work.