There are only two columns and I want to UPDATE only if menu_id exists. Otherwise I want to insert a new row. Here’s my query:
REPLACE `dol_subs_menu_access`
SET `menu_id` = '{$aVars['menu_item']}',
`mlevels` = '{$sMemLevels}'
This creates a new row everytime. Is there something I’m missing?
Are either of the columns in your statement the primary key? My guess is they aren’t, which is what the REPLACE statement (not to be confused with the string replacement function) needs to determine if it is replacing vs inserting…