Yahoo Poland Wyszukiwanie w Internecie

Search results

  1. 1 cze 2015 · If you specify ON DUPLICATE KEY UPDATE, and a row is inserted that would cause a duplicate value in a UNIQUE index or PRIMARY KEY, an UPDATE of the old row is performed. Please read URL for more details.

  2. 29 kwi 2015 · IF EXISTS (select * from users where username = 'something') THEN. update users set id= 'some' where username = 'something'; ELSE. insert into users (username) values ('something'); END IF; end $$. delimiter ; and call it like this: call select_or_insert();

  3. 17 paź 2024 · MySQL provides two ways to insert a row into a table or update the row if it already exists. We can use the INSERT INTO … ON DUPLICATE KEY UPDATE syntax or the REPLACE statement.

  4. 11 kwi 2019 · I need to do and IF/THEN statement in mysql based on whether a value exists in a column. If it exists, I need to perform an update on the record and if it does not, then an error should be thrown. I want to check that the siteID actually exists. How can I add an "IF EXISTS" statement?

  5. 2 lut 2024 · Use REPLACE INTO to Update the Record if It Exists Else Insert It in the MySQL Table. One approach is to use the REPLACE statement if you want to truly replace rows when the INSERT commands would fail due to duplicate UNIQUE or PRIMARY KEY values as described previously.

  6. The UPDATE statement is used to modify the existing records in a table. UPDATE Syntax. UPDATE table_name. SET column1 = value1, column2 = value2, ... WHERE condition; Note: Be careful when updating records in a table! Notice the . WHERE clause in the UPDATE statement. The WHERE clause specifies which record (s) that should be updated.

  7. mysqli_query($con,"IF EXISTS (SELECT * FROM subs WHERE subs_email='$email') UPDATE subs SET subs_name='$name', subs_birthday='$birthday' WHERE subs_email='$email' ELSE INSERT INTO subs (subs_name, subs_email, subs_birthday) VALUES ('$name', '$email', '$birthday')"); mysqli_close($con);

  1. Ludzie szukają również