Php mysql update records affected


















Your not affecting a row in either case, this seems like a strange question, surely your updating via a form which means the user exists to begin with and you know their ID? A standard update query sent from a form if coded right will return either a success message or an error message, in your success message you will get the affected rows ie.

In your error message you could also return the affected rows ie. Add a comment. Active Oldest Votes. Improve this answer. GHugo GHugo 2, 11 11 silver badges 14 14 bronze badges. Sign up or log in Sign up using Google. Sign up using Facebook. Sign up using Email and Password. Post as a guest Name. Active 6 years, 11 months ago. Viewed 20k times. Improve this question. AllisonC you should post that as an answer..

The warning indicates that the query failed rather than that you are using the wrong function. You should implement proper error handling. Add a comment. Active Oldest Votes. Improve this answer. Warning This extension was deprecated in PHP 5. Devart Devart k 22 22 gold badges silver badges bronze badges. Shakti Singh Shakti Singh Submit a Pull Request Report a Bug. Warning This extension was deprecated in PHP 5.

Return Values Returns the number of affected rows on success, and -1 if the last query failed. Records deleted: 10 Records deleted: 0. So if you use one SQL request to insert several rows at a time, and some are inserted, some are just updated, you won't get the real count.



0コメント

  • 1000 / 1000