INSERT, UPDATE, DELETE (multiple iterations)
affected_rows shows number of rows added, updated or deleted. -1 if an error occurred SELECT statements (multiple iterations)
affected_rows (from $stmt), and num_rows (from $res) give the same results here. Remember to get_result() after execute() prior to fetching the rows. Single iteration queries (php 8.2+)
introduced in php 8.2. Combines prepare and bind into a single query. |
Cheatography
https://cheatography.com
MYSQLI prepared statements Cheat Sheet (DRAFT) by davidnunn1
How to use commonly performed MYSQLI commands with prepared statements
This is a draft cheat sheet. It is a work in progress and is not finished yet.