0

I would like to make a request like this one:

DELETE * FROM '" . $my_table . "' 
WHERE 1 AND '--my first column--' = '" . $my_id . "';

The main idea is to delete, no matter what the first column's name of my table is, every rows is like my value, unspecifying the column name.

In CSS I would write:

WHERE column:nth-child(0) = $my_id

Do you know if this is possible? And how it works?

4

1 回答 1

2

第一次运行:

DESC `table`;

然后在 DELETE 中使用在 DESC 中检索到的列名。

DELETE FROM `table` WHERE `column-name` = value;
于 2012-08-07T16:10:43.583 回答