PHP: Update multiple MySQL fields in single query?

Add your multiple columns with comma separations.

This would mean any random hacker could destroy your database. See this question: What's the best method for sanitizing user input with PHP? Also, is style a number or a string?

I'm assuming a string, so it would need to be quoted.

Perfect, thank you! I will look into that link you sent me. Its currently offline and just under development so I have not worried about that yet, but thanks for the advise!

– Chris Mar 10 at 0:59.

Comma separate the values: UPDATE settings SET postsPerPage = $postsPerPage, style = $style WHERE id = '1.

OK, but no upvote because you forgot to point out the glaring flaws in this approach. :) – Tomalak Geret'kal Mar 10 at 0:49.

I cant really gove you an answer,but what I can give you is a way to a solution, that is you have to find the anglde that you relate to or peaks your interest. A good paper is one that people get drawn into because it reaches them ln some way.As for me WW11 to me, I think of the holocaust and the effect it had on the survivors, their families and those who stood by and did nothing until it was too late.

Related Questions