Is it a bad idea to alter an ENUM column on a MySQL table with PHP via an HTML form? -


suppose have enum column on table , want users able expand number of values contains via html form submission on front end using php run query alters table contain more enum values column .

  • is bad idea run queries alter table structure?
  • is there security issue inherent can't see?
  • if sanitize user input before altering table new values sufficient?

as col.shrapnel said, yes, it's bad idea. unless you're making application meant admin database, it's bad practice allow app alter database in way few exceptions (so feel free use temp tables). doubly in php. apparent impact if modify enum list value, field in records in table using old value erased. choice quote mysql manual...

 enum string object value chosen list of permitted values  enumerated explicitly in column specification  @ table creation time.  

Comments

Popular posts from this blog

asp.net - repeatedly call AddImageUrl(url) to assemble pdf document -

java - Android recognize cell phone with keyboard or not? -

iphone - How would you achieve a LED Scrolling effect? -