如何只删除一个记录并非所有具有相同内容的记录?

I echoed some data from database, now when I want to delete some records I have a problem.

Let say I have this records: 3, 3, 4, 6, 3.

<input type="radio" name="ocenaa" value="' . $row['slo'] . '">

When I want to delete the last record (3), it deletes me all records that have content 3...

My query:

$sql="DELETE FROM frend WHERE slo=('$_POST[ocenaa]')";

How can I delete just last record not all three?

It's doing what you would expect... Your data isn't unique. Use unique I'd for each row.

Is there any other way of identifying the row?

Only thing I can tell you is to add a unique(auto_incrementing)_key to the structure phpMySql lets you do this easily. From then you would do this; say the key was called id in php

$query = mysql_query("SELECT `id` FROM frend WHERE 1
ORDER BY `id` DESC
LIMIT 1")

$result = mysql_fetch_array($query);

mysql_query("DELETE FROM frend WHEREid= ".$result[0]); only call DELETE expressly from a unique table-row for the best desired result :).

I'm not a guru lol but this does sound like a familiar problem I ran into before.

Have you tried :

$sql="DELETE FROM frend WHERE slo=('$_POST[ocenaa]') LIMIT 1;";

Also, you must at least consider using mysql_real_escape_string($_POST[ocenaa]) and better, MySQLi or PDO to formulate your query.