Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PHP

php if in database field exists, if exists update, if not create

INSERT INTO <table> (field1, field2, field3, ...) 
VALUES ('value1', 'value2','value3', ...)
ON DUPLICATE KEY UPDATE
field1='value1', field2='value2', field3='value3', ...
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #php #database #field #exists #create
ADD COMMENT
Topic
Name
5+1 =