K
K
khodos_dmitry2021-02-08 21:14:00
MySQL
khodos_dmitry, 2021-02-08 21:14:00

Error PDOException: SQLSTATE[42S22]: Column not found: 1054 Unknown column 'url1' in 'OLD' in?

I make a request like this:

$stm = $pdo_link->prepare('UPDATE `parser` SET `have_new` = 0, `url` = ? WHERE `id` = ' . $id);
$stm->execute([$effective_url]);

Error occurs: Error PDOException: SQLSTATE[42S22]: Column not found: 1054 Unknown column 'url1' in 'OLD' in?
url1 - there is no such column in the table. It used to be, but now I've renamed it.
How an error occurs if this column does not appear in the query. And why does the error say "in 'OLD'"?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
M
Melkij, 2021-02-08
@khodos_dmitry

Trigger on the table, for sure.
Check what triggers are on the table and whether they need to be corrected too after deleting url1

D
Denis A., 2017-08-28
@lemonlimelike

ip? So you will count the number of addresses themselves, and not unique users. Several people can visit your site from one address. You can write in the cookie that the user clicked.
In any case, you need to catch the click event on the picture and send it to php via ajax, and there you already write to the database / file or ip (if it doesn’t exist) or just +1 to the counter (here you already look at the cookies whether you clicked earlier or not ).

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question