"when should i use mysqli instead of mysql?" Code Answer

3

reasons why you should use mysqli extension instead of the mysql extension are many:

  1. mysqli gives you prepared statements - a safer way of sending data to mysql and protecting you from sql injection. this alone should be enough for always choosing mysqli over mysql.
  2. mysqli enables most of the mysql features.
  3. mysqli is object orientated.
  4. mysqli supports prepared statements, transactions and multiple statements.
  5. the old mysql extension is deprecated as of php 5.5.0

and there are other benefits. but mainly, you should focus on security and stabiltity - and mysqli gives you just that.

By user1327961 on June 23 2022

Answers related to “when should i use mysqli instead of mysql?”

Only authorized users can answer the Search term. Please sign in first, or register a free account.