Answer the question
In order to leave comments, you need to log in
How to write IF THEN ELSE?
Hello
I don't know how to write such conditions in the request. For the first time it has to.
I found and tried various methods from the Internet, but they all give nothing but errors.
It's hard to even describe what I want. Something like:
IF (SELECT COUNT(*) FROM replies WHERE id=1 AND flag=1) = 1) THEN
UPDATE replies SET flag=0 WHERE id=1
ELSE
INSERT INTO replies (id,flag) VALUES(1,0)
END
Answer the question
In order to leave comments, you need to log in
Why such perversion?
INSERT INTO `replies` (`id`, `flag`)
VALUES (:id, 0)
ON DUPLICATE KEY UPDATE `flag` = 0;
I do not recommend using overflow-x: hidden in this particular case. The best solution would be to use the word-wrap property: break-word - wrapping a long word to a new line. This way your content won't spill out of the block even in extreme cases. Using overflow-x will tritely cut off the part of the word that goes beyond the block, which in practice will give a negative result.
A prime example is using the word Tetrahydropyranylcyclopentyltetrahydropyridine, cutting which will make the content lose its meaning.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question