Skip to content

Latest commit

 

History

History
74 lines (65 loc) · 3.71 KB

n5ba.md

File metadata and controls

74 lines (65 loc) · 3.71 KB

Stars Badge Forks Badge Pull Requests Badge Issues Badge GitHub contributors Visitors

Don't forget to hit the ⭐ if you like this repo.

PHP: MySQL and CRUD

Set B

Here are the answers to the questions:

  1. a) Create, Read, Update, Delete
  2. a) MySQLi
  3. a) To establish a connection to a MySQL database
  4. a) mysqli_query()
  5. a) To fetch a row from a database result as an associative array
  6. a) Using mysqli_num_rows()
  7. a) To retrieve the ID generated by the previous INSERT query
  8. a) UPDATE
  9. a) DELETE
  10. a) To get the number of rows affected by a query
  11. a) mysqli_real_escape_string()
  12. a) Using mysqli_error()
  13. a) To close a database connection
  14. d) mysqli_table_exists()
  15. a) Using mysqli_affected_rows()
  16. d) All of the above
  17. a) To commit a transaction
  18. a) To rollback a transaction
  19. c) mysqli_connect_error()
  20. a) To prevent SQL injection and improve performance
  21. a) mysqli_stmt_bind_param()
  22. a) To execute a prepared statement
  23. a) To get the result set of a prepared statement
  24. a) Using mysqli_stmt_get_result()
  25. a) mysqli_stmt_fetch()
  26. a) To close a prepared statement
  27. a) mysqli_error()
  28. a) To fetch a row from a database result as an enumerated array
  29. a) To fetch a row from a database result as an array (both associative and enumerated)
  30. a) To fetch a row from a database result as an object
  31. a) mysqli_num_rows()
  32. a) To move the internal result pointer to a specified row number
  33. a) To retrieve the number of fields in a result set
  34. a) mysqli_fetch_field()
  35. a) To free the memory associated with a result set
  36. a) mysqli_insert_id()
  37. a) To escape special characters in a string to prevent SQL injection
  38. a) By checking the return value of mysqli_query()
  39. a) To retrieve the number of rows in a result set
  40. a) mysqli_fetch_row()
  41. a) To retrieve the metadata of a field in a result set
  42. a) Using mysqli_field_count()
  43. a) To fetch all rows from a result set as an array
  44. c) mysqli_fetch_array()
  45. a) To store the entire result set from a query in memory
  46. a) Using mysqli_affected_rows()
  47. a) To execute multiple SQL queries in a single call
  48. b) Using mysqli_store_result()
  49. a) To retrieve the result set of a query incrementally
  50. c) mysqli_store_result()

Contribution 🛠️

Please create an Issue for any improvements, suggestions or errors in the content.

You can also contact me using Linkedin for any other queries or feedback.

Visitors